NSB 7.4.2 Phonegap Build Android App


Recently, I found a lot of difficulties to make the PhoneGap Build and install APK onto the Android device. Finally I tested with the following procedures. Please suggest any better way.

  1. Add the following line onto the config.xml and change the id=“com.nsbasic.test”.
<preference name="phonegap-version" value="cli-9.0.0" />
<preference name="pgb-builder-version" value="1" />
  1. Input the Auth Token under the Tools - Preferences - PhoneGap - Build
  2. RUN - Make Native App with PhoneGap Build
  3. Copy the APK file onto Android device
  4. First time install is OK.
  5. If modified the project, it need to change the version number on the project then RUN PGB again to create the APK file
  6. Uninstall the old App in the device
  7. Install with the new APK with difference version number, otherwise it cannot install

Compare with the previous version of NSB and PGB, it is very convenience for development, but now it is not. Please suggest any easy way.

First, the changes in AppStudio 7.4.2 were required because Google changed its requirements for apps:

Taking each of your steps in turn:

  1. No need to change the id. It needs to be unique: you’ll have problems if your id is the same as everyone else’s. Leave the id alone.
    Also, the preference lines are not needed. AppStudio 7.4 takes care of setting cli-9.0.0, and the other preference line should not be needed.

  2. Yes. This is the same as before. Auth tokens have been used by PhoneGap Build since 2014.

  3. 4 5 Yes - same as before.

  4. 7 You’re not saying whether you are doing a debug or release (signed) build. If you’re doing a debug build, you will need to delete the old version before installing the new. Have a look at this thread:
    Install new apk without uninstall existing app

  5. I have not found this to be necessary.

Google has increased the security on Android apps. The changes you’re seeing are what was needed for that.

1 Like

For your point 4, I am testing on the debug build, so when I want to test the APP, I need to uninstall the old APP, then install the new APP, but I also need to change the version number within NSB before build, otherwise it cannot allow me to install onto the device.

Are you making a release or debug build? (i.e., is it signed?)

I’m able to install new debug builds without having to increment the version. I still have to delete the old one first, though. It might be that different versions of Android work differently.

I am making the debug build with the PGB signed. I need to uninstall the APP and then I cannot install the same APK (same APP as the uninstall), unless I changed the version number (only change the version number) and build again.

The device is Honeywell EDA50 using Android 7.

Running a quick test here, I’m seeing it’s OK to install a new release build in Android 6 without incrementing the versionCode in Config.xml.

However, in Android 7, I do have to increment the versionCode.

It is not the versionCode in Config.xml, but I need to change the “version” in the project properties then uninstall the app first, then install the app with different version. Otherwise it cannot install.

I just try with another project and during PGB, it show the “Auth Token” exceed the private app limit, so I need to clear the “Auth Token” then build. It work. Is it OK without “Auth Token”?

That version should also work.

Don’t delete your Auth Token. You need it to create production builds, so put that back in. You’re making Debug builds otherwise.

A free PhoneGap account has a limit of one app at a time. If you go to the build.phonegap.com website, you can delete the app which is there to upload a different one.

OK. I see. Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.