DEV Community


Posted on

Important to know for Ionic AppFlow's Live Update

When you decided to develop a hybrid app, it could be the one of the advantages of hybrid app that you can update the app right away without updating through App Store or Play Store.
I investigated the live update feature of Ionic AppFlow, and the AppFlow service itself is pretty much neat and looking-good and the process of deploying and live-updating looks so much easy. So I chose to use Ionic AppFlow for live updating.
BUT, for almost more than a week, I was in trouble making the live update to work, and the support department in Ionic was not helpful so much. So I decided to write What the problem I met was and share to solve the problem.

I tried the live update feature from the instruction from appFlow page like following: linking with ionic link ${your_app_id} and ionic deploy add to set up Ionic Deploy.

Then you can meet the following errors.

1. Missing values

Then you can see some added text in the android/app/src/main/res/values/strings.xml:

  <string name="ionic_app_id">${your_app_id}</string>
  <string name="ionic_channel_name">Master</string>
  <string name="ionic_update_method">auto</string>

If you chaned the channel name and update method, it would be different.
Then if you run the application from Android Studio, you will meet the following error:

E/m.midas.jobfle: Invalid ID 0x00000000.
E/PluginManager: Uncaught exception from plugin
    android.content.res.Resources$NotFoundException: String resource ID #0x0
        at android.content.res.Resources.getText(
        at android.content.res.Resources.getString(
        at android.content.Context.getString(
        at com.ionicframework.common.IonicCordovaCommon.getStringResourceByName(
        at com.ionicframework.common.IonicCordovaCommon.getNativeConfig(
        at com.ionicframework.common.IonicCordovaCommon.getPreferences(
        at com.ionicframework.common.IonicCordovaCommon.execute(
        at org.apache.cordova.CordovaPlugin.execute(
        at org.apache.cordova.PluginManager.exec(
        at com.getcapacitor.MessageHandler.callCordovaPluginMethod(
        at com.getcapacitor.MessageHandler.postMessage(
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.Looper.loop(
E/Capacitor/Console: File: capacitor-runtime.js - Line 2654 - Msg: Uncaught (in promise) String resource ID #0x0

You can see the error message related in chrome inspector Uncaught (in promise) String resource ID #0x0. It means that live update didn't make due to the error.
In the process of loading and live updating the app, it checks some environmental values from strings.xml or SharedPreference. However, if there is some missing values, the process will stop and just go to the next step.
I found some missing value keys: ionic_max_versions, ionic_update_api, ionic_min_background_duration.
So, what you have to do is adding some additional values in strings.xml:

  <string name="ionic_app_id">${your_app_id}</string>
  <string name="ionic_channel_name">Master</string>
  <string name="ionic_update_method">auto</string>
  <string name="ionic_max_versions" >2</string>
  <string name="ionic_update_api"></string>
  <string name="ionic_min_background_duration">30</string>

Then the error will be resolved and live update will done.
Next is additional information while I was solving the problem.

2. ionic_update_api

First, I've got the missing key values from debugging and tracking the code inside the Android proejct, so I did not know what that mean and what is the appropriate values for that keys. I found a hint from the merged commit (, but it was not helpful to find the appropriate value.
Then I typed the value for ionic_update_api like following:

<string name="ionic_update_api"></string>

and the error happened:

Uncaught SyntaxError: Unexpected token < in JSON at position 0

After I resolved the problem, I now know that the api address for checking the update is wrong. I fond the appropriate value googling almost a week. It means that you can manipulate the api address.
I don't understand why this important information cannot be found anywhere.

Anyway, now the live update is perfectly done.

you can find the post in the Ionic Forum here:

Top comments (2)

rangerrick profile image
Benjamin Reed

OH GOD thank you for this post. I changed the channel config and some plugin stuff at the same time and I was beating myself over the head trying to figure out what plugin initialization was busted. ;)

Fixing up strings.xml did it for me. 👍

wmadden profile image
Will Madden

You deserve a medal! 🥇