Software Archive
Read-only legacy content
17061 Discussions

Version 2496 Android Build error with upgraded project

Nick_F_2
New Contributor III
654 Views

Existing project upgraded to V2496 fails on build  for Android, but builds for iOS. Android error is below.
 

FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version 14 declared in library 

BUILD FAILED

Total time: 4.667 secs

.../myappname/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: .../myappname/platforms/android/gradlew with args: cdvBuildRelease,-b,.../myappname/platforms/android/build.gradle,-Dorg.gradle.daemon=true
Command finished with error code 8: .../myappname/platforms/android/cordova/build --release
ERROR building one of the platforms: Error: .../myappname/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: .../myappname/platforms/android/cordova/build: Command failed with exit code 8
    at ChildProcess.whenDone (/Developer/cordova/5.1.1/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
0 Kudos
7 Replies
John_H_Intel2
Employee
654 Views

"uses-sdk:minSdkVersion 10 cannot be smaller than version 14 declared in library "

Did you try changing minSdkVersion  to 14?

0 Kudos
Nick_F_2
New Contributor III
654 Views

Hi John

Sorry where do I do that.

0 Kudos
Nick_F_2
New Contributor III
654 Views

I have found an AndroidManifest.xml file that contains this line:-

<uses-sdk android:minSdkVersion=“7” android:targetSdkVersion=“10”/>

Which do I change as the error refers to 10 should be 14, but the minSdkVersion shows 7.

I have tried changing 7 to 14 and 10 to 14 on separate build but get the same error.

0 Kudos
Nick_F_2
New Contributor III
654 Views

Ive chnaged 7 to 14 and 10 to 22 (Found online) but still getting a build error
 

Build Log:
  • Building a Cordova 5.1.1 application.
  • The application name is "iPatrolCloud"
  • The package name is "uk.ltd.codeworx.ipatrolcloud"
  • Plugin "cordova-plugin-device" (1.0.1) installed.
  • Plugin "cordova-plugin-splashscreen" (2.1.0) installed.
  • Plugin "cordova-plugin-statusbar" (1.0.0) installed.
  • Plugin "cordova-plugin-dialogs" (1.1.1) installed.
  • Plugin "cordova-plugin-geolocation" (1.0.1) installed.
  • Plugin "cordova-plugin-vibration" (1.2.0) installed.
  • Plugin "intel.xdk.camera" (1.2.3) installed.
  • Plugin "intel.xdk.device" (1.2.5) installed.
  • Plugin "cordova-plugin-legacy-whitelist" (1.1.0) installed.
  • App name updated to [iPatrolCloud]
  • Updated "minSdkVersion" with "10"
  • Updated "targetSdkVersion" with "19"
  • Updated "installLocation" to "auto"
  • Added "screenOrientation" to "portrait"
  • Updated "versionCode" to "1"
  • Updated "versionName" to "0.0.1"
  • Added "debuggable" to "false"
  • An unexpected error occured while attempting to build the application.

Say Updated minSdkVersion with 10 still.

 

0 Kudos
John_H_Intel2
Employee
654 Views

Can you try creating a blank app, dont change anything (no plugin changes and no changes to the additions file), then building it?

0 Kudos
Pamela_H_Intel
Moderator
654 Views

Also, don't change it in the manifest file, change it in the build settings. (And know that if you change it to 14 - which you have to do for Crosswalk 5.1.1 - your app will no longer work on Android devices running less than Android 4.x.)

0 Kudos
Amrita_C_Intel
Employee
654 Views

You might be experiencing build problems when you build for Android using an upgraded project. Many old projects are set to API level 10 in the “Minimum Android API” field. This works with CLI 4 (and older) but does not work with CLI 5 builds. CLI 5 builds against Cordova-Android 4.1.0, which only supports building for Andorid 4.0 and above. Android 4.0 corresponds to API level 14, not 10.

But as Pamela mentioned you  must change the “min android api” to 14 from 10 be sure you also know that your app will now only install on Android 4.0 and higher devices, whereas, previously, it would install on Android 2.3 and higher devices. Thus, if you want to continue to support Android 2.3+ devices they need to build with CLI 4.1.2.

 

0 Kudos
Reply