Phonegap build and build commands do not work due to minSDK version

When I try to create a phonegap project with the following command;

phonegap create myapp --id com.apps.myapp --name myapp 

I get the following error;

 Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller version 10 declared in library projectName\platforms\android\ build\ intermediates\exploded\aar\android\cordovaLib\unspecified\debug\AndroidManifest.xml . Suggestion : use tools.overrideLibrary = "org.apache.cordova" to force usage. 

I worked with such commands perfectly, but something happened right after installing Android Studio (with Gradle) and an updated version of cordova to 5.0.0-0-27.1. Is there any way to get rid of this gradle? I think that due to Gradle and its configuration, the create phonegap command started working differently.

Or Gradle was always there, but something else ruined my configuration. If not, please help me remove everything about Gradle and work correctly.

In the end (if removing Gradle does not make sense), how will I specify the minSDK version using the command line when creating the project ?,

+6
source share
4 answers

I don’t know why the latest version caused such a problem, but when I return to the version of the cord and the phone version in version 3.x, the problem disappeared.

Check available versions;

 npm view phonegap versions 

To delete the current version

 npm uninstall -g phonegap 

To set a specific pre. version

 npm install -g phonegap@3.5.0-xxx 

You can use the same commands for the cord frame.

An alternative solution without installing older versions . (If you had a phone game project before, and you had problems after updating the framework versions)

Install the latest versions of both Cordova and Phonegap, then create your project with the following command;

 cordova create projectName com.example.projectName projectName 

Then copy the .cordova folder from one of the projects that you created earlier, and for using the "phonegap build" command without errors. Then paste it into your new main project path, where the www folder is also located.

Here you go, now you can run phone table commands without a build failure.

+1
source

The solution adds the line:

 <preference name="android-minSdkVersion" value="10" /> 

in your config.xml file

See: Where to change the minSdkVersion parameter in PhoneGap application

+8
source

Unfortunately.

The previous solution for the “build phone calls” command is not to “create a phone saver”

What is your OS?

On Windows 7 with cord version 5.0.0-0-27.1 the command:

 phonegap create myapp --id com.apps.myapp --name myapp 

successfully complete

0
source

Please configure the default template application:

 "C:\Documents and Settings\admin\.cordova\lib\www\hello-world-template\master\www\config.xml" 

where "admin" is your Windows username

0
source

Source: https://habr.com/ru/post/986523/


All Articles