Reputation: 1838
I renamed my android app (using eclipse refactor->rename
) now it crashes before I get to the activity initialisation. Here's the call stack:
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2417
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2512
ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119
ActivityThread$H.handleMessage(Message) line: 1863
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4363
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] [local variables unavailable]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
I have some native methods in my app but they don't match the signature in Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean)
so I'm not sure if that's relevant. Besides, I would imagine it would crash when I tried to call that if there was a problem with the native method (at least, that's what happened when I was developing them). I can't get a break point anywhere on this so I'm not sure what's going on or how to debug it. I imagine there is a file somewhere with a cryptic reference to the old project name but I can't find it.
Any help would be appreciated.
Upvotes: 0
Views: 1271
Reputation: 1838
It wasn't renaming the project that caused the problem and the NDK wasn't to blame - that was a wild goose chase because I saw the string 'native method' in the call stack.
The problem was that I'd renamed the activity as well and that did need renaming in the manifest, just like you guys had said.
I think there's a lesson here for refactoring too much at a time and too late at night! Anyway, problem solved! Thank you guys very much for your time.
Upvotes: 0
Reputation: 34652
Having just done this myself, I experienced similar (but not exactly the same problems).
The biggest thing problem with doing Refactor > Rename is that it will only manage the naming of the Java portions of your code. It will not update any of the XML (which there is quite a bit in an Android application). You will have to do a search within your project for the old name and manually switch it over to the new name. This includes files such as AndroidManifest.xml as well as others (most likely any XML file). In addition, if you changed the package structure of your classes, you will have to update that as well (though that does not appear to be what you did in this case).
Upvotes: 3
Reputation: 44919
I would check your native methods since the naming of native methods tends to depend on Java class names.
Also, you will have to change names in your AndroidManifest.xml to reflect your changes.
Otherwise, could you post the actual error message accompanying the stack trace?
Upvotes: 1