Cordova – A Weblog of Priyank Maniar https://priyank.rocks Articles on web development & mobile app development Tue, 14 Jan 2020 01:44:48 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 How to git clone a private repository? https://priyank.rocks/how-to-git-clone-a-private-repository/ Mon, 12 Nov 2018 17:50:56 +0000 http://priyank.rocks/?p=244 We expect that the repository would prompt you for entering details but sometimes it doesn’t.

Adding –nofetch has helped me get this issue resolved.

E.g.

1
sudo cordova prepare --nofetch
]]>
How to resolve cordova conflicts between plugins? https://priyank.rocks/how-to-resolve-cordova-conflicts-between-plugins/ Sun, 27 May 2018 14:34:19 +0000 http://priyank.rocks/?p=135 Many plugins have the code which requires some specific version of the google library. Say some require 11.2 of google play service and some require 11.3. In order for Gradle to work we must make sure that all the plugins requests same version of the library.

Easier said than done.

First step is to open project.properties file. Look for any easy to find version conflicts.

If the issue still persists, try to narrow down the issue by removing the suspected plugins and see if the build works then. You can also lookup the error library in the entire project and try to find where the issue is.

These days many plugin developers creates some paths through which it is very easy to pick the library version within the install command or as a part of config.xml

Check the cordova plugin list and see make sure it all looks as you expect.

It is important to know the latest version of the plugin. This can easily be known by looking up the library name over Google.

As far as I remember any changes made in plugin.xml requires to remove platform and add again or at least the plugin.

Many a times the issue is with + notation of the version.

For debugging, you can try cordova clean once.

Note: It is wise to stick to the latest version of all the libraries. Latest versions of the libraries has the most recent version of the fixes and for the latest devices.

]]>
Ionic / Cordova Android build errors https://priyank.rocks/ionic-cordova-android-build-errors/ Thu, 15 Mar 2018 03:59:31 +0000 http://priyank.rocks/?p=107 As soon as android sdk releases an update. Gradle updates it automatically. Many a times it results in the build error. It is important to pin some of the libraries to a specific version.

There are many ways to do this.

  1. Change in build-extras.gradle

    This will wipe out everytime you remove the platform. You need to manually add those lines again. Perhaps we could have a hook here do the job as well.

    configurations.all {
        resolutionStrategy {
            force 'com.android.support:support-v4:27.1.0'
        }
    }
  2. Installing a plugin to pin the version
]]>