Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Luigi_Cama
Beginner
302 Views

Cordova CLI - App not installed

Good morning guys.
I find comfortable CLI solution, I managed to fill in the app, also overcoming the "gradle" problem, but there was a problem I could not solve. I should update an existing app on Android and return the "App not installed" error. To fix this problem, I must uninstall the compiled app with XDK and then install that compiled with Cordova CLI. What can it depend on? I checked the version of the APP in config.xml, it is higher than the previous one; I tried to change the android version; Plugins are the same as the previous version. Do you have any suggestions?

Thanx.

Tags (2)
0 Kudos
3 Replies
PaulF_IntelCorp
Employee
302 Views

My suspicion is the App Version Code is the problem. There have been several changes to how this is handled by the XDK and by Cordova over the past few years, which can cause confusion. See this article for some help > https://software.intel.com/en-us/xdk/articles/android-and-crosswalk-cordova-version-code-issues < It's possible the version code on the previously installed app is less than the one in the newly build app.

And since you have the Android build tools on your system it means you have a copy of the aapt tool, which can be used to inspect the actual version code in your APK files. Use "aapt list -a my-app.apk" to show the contents of the AndroidManifest.xml file embedded in your APK file. You may have to search to find that tool, here's what I use:

$ cat bin/aapt-manifest.sh 
#!/bin/sh

## aapt is no longer in the path (if you follow the path guidelines for Android SDK)
## so we need to "find" the path to appt, within the Android SDK installation

#aapt list -a $@

# an alternative approach that works on Linux and Mac

if [ "$ANDROID_HOME" != "" ]
then
  AAPT=`/usr/bin/find $ANDROID_HOME -name aapt 2>/dev/null`
#  echo "$AAPT"
  $AAPT list -a $@
else
  echo The "aapt" utility cannot be found. Is your "ANDROID_HOME" env variable set?
fi

 

Luigi_Cama
Beginner
302 Views

Thanks Paul.

I was based only on what is explained in https://software.intel.com/en-us/xdk/articles/android-and-crosswalk-cordova-version-code-issues.

I do not use crosswlak. I had android-versionCode = "27". Changed to android-versionCode = "2700" (27x10 & 0).

App installed correctly.

After I tried 289.
The previous version was 288.
App installed correctly.

What is the correct calculation?

Thank you so much.

PaulF_IntelCorp
Employee
302 Views

Depends... the documentation from Cordova CLI appears to be incomplete, but it will depend on which version of CLI you are using (as well as which version of cordova-android you are using, etc.). See this CLI doc page > https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-cod... < However, I believe the article is still correct (the part that would apply is the first part regarding CLI 5). Best way is to test what happens to the version code when you do a build (that is, make note of what you set it to in the config.xml and then check what is actually inserted into the APK using the aapt tool).

Reply