开发者

Android signed app ClassNotFoundException

开发者 https://www.devze.com 2023-02-14 11:31 出处:网络
I have an app that works fine w开发者_如何学编程hen deployed locally.I have signed it in eclipse, and the first time i did that it worked.I\'ve made another build, and that works locally, but after i

I have an app that works fine w开发者_如何学编程hen deployed locally. I have signed it in eclipse, and the first time i did that it worked. I've made another build, and that works locally, but after i sign it, trying to open it on the phone immediately blows up with:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.myapp/com.myapp.MyAoo}: java.lang.ClassNotFoundException: com.myapp.MyAoo in loader dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk

I've tried uninstalling and reinstalling. Same thing. Locally deployed, Unsigned app works. Signed app bombs. Any thoughts?


Are you using proguard obfuscation? It will only kick in for signed jars, and will remove classes it deems "unused".

Try turning it off and re-sign and then try again.

To disable make sure that the file: /default.properties does not contain proguard.config property.

see http://developer.android.com/guide/developing/tools/proguard.html for more


This turned out to be some weird setting somewhere. I still haven't really "figured it out". I was using eclipse to export the signed package, but I actually develop with intellij idea. I exported from idea, and it all worked fine.


I had the exact same problem and it baffled me because I had previously signed and exported the apk on numerous occasions without problem. After disabling ProGuard to make sure it was not the cause, I cleaned the project in Eclipse:

From the top menu - click 'Project', click 'Clean' on the drop down menu that appears, select the project(s) to clean and click 'OK'.

After doing that, I was able to run the signed and exported apk without it crashing on startup.


I have the same problem and I solved as follows:

  1. create the folder "libs" on root folder of application, if you already have the folder "lib" rename it to "libs"
  2. add android-support-v4.jar at folder "libs", verify if you have it in this folder "/your directory of android installation/extras/android/support/v4" if dont have get from here
  3. Clean the project: eclipse >> project >> clean
  4. export signed application

for me it's works fine I hope that solves your problem too.

0

精彩评论

暂无评论...
验证码 换一张
取 消