user1119607
user1119607

Reputation: 81

Android app crashs after changing package name

I changed the package name of my app and its now crashing. In the manifest file I changed the package name and in the code as well. Thats what logcat says:

01-19 21:38:47.466: W/ResourceType(13905): No package identifier when getting value for resource number 0x00000000
01-19 21:38:47.476: W/dalvikvm(13905): threadid=9: thread exiting with uncaught exception (group=0x400205a0)
01-19 21:38:47.476: E/AndroidRuntime(13905): FATAL EXCEPTION: GLThread 10
01-19 21:38:47.476: E/AndroidRuntime(13905): android.content.res.Resources$NotFoundException: Resource ID #0x0
01-19 21:38:47.476: E/AndroidRuntime(13905):    at android.content.res.Resources.getValue(Resources.java:901)
01-19 21:38:47.476: E/AndroidRuntime(13905):    at android.content.res.Resources.openRawResource(Resources.java:826)
01-19 21:38:47.476: E/AndroidRuntime(13905):    at android.content.res.Resources.openRawResource(Resources.java:808)
01-19 21:38:47.476: E/AndroidRuntime(13905):    at com.appboss.min3d.parser.ObjParser.parse(ObjParser.java:60)
01-19 21:38:47.476: E/AndroidRuntime(13905):    at com.appboss.mercurysim.Rocket.initScene(Rocket.java:325)
01-19 21:38:47.476: E/AndroidRuntime(13905):    at com.appboss.min3d.core.Scene.init(Scene.java:272)
01-19 21:38:47.476: E/AndroidRuntime(13905):    at com.appboss.min3d.core.Renderer.onSurfaceCreated(Renderer.java:74)
01-19 21:38:47.476: E/AndroidRuntime(13905):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1348)
01-19 21:38:47.476: E/AndroidRuntime(13905):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

Upvotes: 3

Views: 3346

Answers (3)

Francesco Vadicamo
Francesco Vadicamo

Reputation: 5542

Try to do these steps:

  1. clean the project (Project > Clean...)
  2. fix project properties (right click on project in Package Explorer > Android Tools > Fix Project Properties)
  3. delete all import android.R if present
  4. check for .getIdentifier(resourceName, defType, "your_old_package_that_is_now_changed"); and fix it with the new package name

Upvotes: 1

DigitalMan
DigitalMan

Reputation: 2540

It looks like this may have caused a discrepancy between the package name, and the class name, or at least the package declaration. If you just renamed the file, then the code isn't matching. And if you did fix the code, there may be some other method that is expecting the package with its old name.

Upvotes: 0

Force
Force

Reputation: 6392

Did you change your classname in the manifest as well?

Upvotes: 1

Related Questions