I made some changes on controllers and providers and from ionic serve it is working great! but now when i do ionic cordova run/build android the apk did not start. it compile and build the apk and installs it but it crashes at first try to open…
This is the crash report…
java.lang.RuntimeException: Unable to start activity ComponentInfo{ionicionic.app/ionicionic.app.MainActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6806)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.content.res.Resources.getText(Resources.java:360)
at android.content.res.MiuiResources.getText(MiuiResources.java:97)
at android.content.res.Resources.getString(Resources.java:453)
at android.content.Context.getString(Context.java:587)
at com.ionicframework.deploy.IonicDeploy.getStringResourceByName(IonicDeploy.java:141)
at com.ionicframework.deploy.IonicDeploy.initialize(IonicDeploy.java:170)
at org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:57)
at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171)
at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
at org.apache.cordova.PluginManager.init(PluginManager.java:86)
at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:117)
at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149)
at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224)
at mentorme.app.MainActivity.onCreate(MainActivity.java:39)
at android.app.Activity.performCreate(Activity.java:7224)
at android.app.Activity.performCreate(Activity.java:7213)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
… 11 more
The super wierd thing is that if I remove the android platform ionic cordova platform rm android and then build the app again. It works but only the fist build, if I run a second ionic cordova run/build android no code changes It crashes
I need to remove the android platform in order to build and only the first build works.
If I run ionic cordova run android or ionic cordova build android for the second time it breaks the apk.
So my only workaround right now is to reinstall the platform every time I need to build the apk
Then move all the project folders except plugins (css, www, img, src, resources), also use my old config.xml (the one who had all the plugins info).
Then add the platforms.
All the plugings works good, I have had to upgrade some plugins versions since the angular core is newer in the latest ionic v3 template but then it works at any build/run.
Thank you all who watch and reply!
This forum Rocks!
Hi @Dsousa. Just googled your post when I ran into the same behaviour. It occured to me that my app wasn’t just running on my phone, but actually installed. And as it turns out, Android won’t let you install another app with the same name (sideloaded as we do).
The proper solution is to go into settings -> Apps & Software and uninstall your App. You may have to check your config.xml to remind yourself of what the name is. Since I was in the middle of development, mine was still called MyApp! So, I went in and found (2 as it happens) apps of that and similar names and zapped them. Subsequent run worked fine! Might save a few hours next time this happens!