Software Archive
Read-only legacy content
17060 Discusiones

java.lang.RuntimeException: Unable to start activity ComponentInfo

Darrell_L_
Principiante
7.747 Vistas

I have built a hybrid application with Intel XDK, When I first install the application it works fine.  Subsequent attempt to launch the application from my android device fail, I submitted the error to google play so i could see it.  I get the following error message (from google play): 

 

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sw.myappname/com.sw.myappname.CordovaApp}: android.content.res.Resources$NotFoundException: Resource ID #0x7f020001
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2790)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2855)
    at android.app.ActivityThread.access$900(ActivityThread.java:181)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6117)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f020001
    at android.content.res.Resources.getValue(Resources.java:2358)
    at android.content.res.Resources.getDrawable(Resources.java:1863)
    at android.content.Context.getDrawable(Context.java:408)
    at android.view.View.setBackgroundResource(View.java:17285)
    at org.apache.cordova.CordovaActivity$5.run(CordovaActivity.java:947)
    at android.app.Activity.runOnUiThread(Activity.java:5601)
    at org.apache.cordova.CordovaActivity.showSplashScreen(CordovaActivity.java:970)
    at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:368)
    at com.sw.myappname.CordovaApp.onCreate(CordovaApp.java:33)
    at android.app.Activity.performCreate(Activity.java:6374)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2743)

0 kudos
11 Respuestas
John_H_Intel2
Empleados
7.747 Vistas

What plugins do you have installed?

What device are you testing on?

Darrell_L_
Principiante
7.747 Vistas

Hello John,

my plugins are:


cordova-plugin-console
Device cordova-plugin-device
Splashscreen cordova-plugin-splashscreen
StatusBar cordova-plugin-statusbar
Keyboard ionic-plugin-keyboard
Whitelist cordova-plugin-whitelist

The device is a samsung galax tab A

 

 

John_H_Intel2
Empleados
7.747 Vistas

Can you try creating a new blank app and without modifying any of the plugins, build it and install it?

What is the OS of the device?

Darrell_L_
Principiante
7.747 Vistas

The os is android 5 lollipop

I created a demo app like you suggest.  

It appears to be working right now.   That said, the app I am having issues with worked when I first installed it too though.    Not sure this helped.  The app that I am having trouble with was opened and closed a few times when I first installed it, and all seemed fine.  A few days later I tried to open the app, and that's when I got the error message

 

 

 

Elroy_A_Intel
Empleados
7.747 Vistas

I recommend trying the Crosswalk for Android build option as well.

Darrell_L_
Principiante
7.747 Vistas

I tried that, but i received and error message, which i will start a seperate post for, I would like to address the original post here

 

Hello I am trying to do a crosswalk build, and I am getting the following error:


The build failed. An error occurred while building the application. Verify your build assets are correct and try again.
Build Log:
The App ID is "com.sw.myappname"
The App Name is "my app name"
Crosswalk Version: 14.43.343.17
Plugin "org.apache.cordova.device" (0.2.13) installed.
Plugin "org.apache.cordova.splashscreen" (0.3.5) installed.
Plugin "com.rjfun.cordova.extension" (1.1.4) installed.
Plugin "org.apache.cordova.geolocation" (0.3.11) installed.
Plugin "org.apache.cordova.vibration" (0.3.12) installed.
Plugin "com.google.playservices" (19.0.0) installed.

Creating a crosswalk build may not solve me problem, but maybe the 2 error messages are related

 

PaulF_IntelCorp
Empleados
7.747 Vistas

Switch to CLI 5.1.1 and build with CW 15.

Darrell_L_
Principiante
7.747 Vistas

just did that, i get a new error

The build failed.
An error occurred while building the application. Verify your build assets are correct and try again.
Build Log:
  • Building a Cordova 5.1.1 application.
  • The application name is "my app name"
  • The package name is "com.myappname"
  • Error: Plugin "Device" failed to install.
  • Plugin "cordova-plugin-splashscreen" (2.1.0) installed.
  • Plugin "cordova-plugin-console" (1.0.1) installed.
  • Plugin "cordova-plugin-whitelist" (1.0.0) installed.
  • Plugin "ionic-plugin-keyboard" (1.0.7) installed.
  • Plugin "cordova-plugin-crosswalk-webview" (1.3.1) installed.

 

PaulF_IntelCorp
Empleados
7.747 Vistas

Which plugin is the one named "Device"? is it the standard Cordova plugin, something else,... ??? Are you including all the plugins via the plugin manager? Do not use the additions.xml file for this purpose.

Darrell_L_
Principiante
7.747 Vistas

 

I have upgraded to cli 5.1.1, and I have reinstalled the plugins that were causing an error.  I was able to perform a crosswalk build.  I get similar but different behavior as before.  After first installing the arm version of the application to my device, the application works as it should.   The application makes a web service call for content, and also uses admob, and at the start both work as expected.

I decided to minimize the application, and the next day I resumed it, and then for some reason the content from the web service and the admob banner wouldn’t show.  I tried closing the application, and reopening it again, and I got the same error message as before that “Unable to start activity ComponentInfo” ,

I closed the application, an I left it for a couple hour, I started the application, and it started without error, but the webservice content, and the admob banner are not displaying, I can click links to static content, and that displays as expected

I have now tried closing the application and reopening the app, and it starts without the error message, but with no webservice content or admob banner

 

PaulF_IntelCorp
Empleados
7.747 Vistas

Do you get this same behavior with the "Hello Admob" sample app? It helps to try the same process using a known good reference app, so you can determine if it is something with the build system, the plugins, or your code.

Responder