Activity NoClassDefFoundError using Android Studio -
note: not missing class in jar, don't rush mark duplicate.
i'm porting big project eclipse android studio. succeeded see splashactivity on screen, fail mainactivity launched after splashactivity. i'm getting following error on runtime:
> 06-13 14:42:30.176 12389-12389/com.totalboox e/androidruntime: fatal > exception: main process: com.totalboox, pid: 12389 > java.lang.noclassdeffounderror: com.androidcore.android.main.mainactivity$4 > @ com.androidcore.android.main.mainactivity.<init>(mainactivity.java:587) > @ java.lang.class.newinstance(native method) > @ android.app.instrumentation.newactivity(instrumentation.java:1067) > @ android.app.activitythread.performlaunchactivity(activitythread.java:2317) > @ android.app.activitythread.handlelaunchactivity(activitythread.java:2476) > @ android.app.activitythread.-wrap11(activitythread.java) > @ android.app.activitythread$h.handlemessage(activitythread.java:1344) > @ android.os.handler.dispatchmessage(handler.java:102) > @ android.os.looper.loop(looper.java:148) > @ android.app.activitythread.main(activitythread.java:5417) > @ java.lang.reflect.method.invoke(native method) > @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:726) > @ com.android.internal.os.zygoteinit.main(zygoteinit.java:616)
mainactivity declared in manifest:
<activity android:name="com.androidcore.android.main.mainactivity" android:label="@string/app_name" android:theme="@android:style/theme.holo.light" android:windowsoftinputmode="statehidden|adjustpan" android:launchmode="singletop"> <intent-filter> <action android:name="com.totalboox.message"/> <category android:name="android.intent.category.default"/> </intent-filter> </activity>
the code @ mainactivity:587
// pushwoosh lib integration (see https://www.pushwoosh.com/programming-push-notification/android/native-android-sdk-integration/)
broadcastreceiver mbroadcastreceiver = new registerbroadcastreceiver() { @override public void onregisteractionreceive(context context, intent intent) { checkmessage(intent); } };
where registerbroadcastreceiver external lib (pushwoosh) handling notifications.
the code in splashactivity starting mainactivity:
intent mainactivity = new intent(this, mainactivity.class); mainactivity.putextra("deep_link_book_id", deeplinkbookid); startactivity(mainactivity); finish();
googling found people having problem jar. in case mainactivity.java 1 of source modules, , package name package com.androidcore.android.main;
declared in manifest. project built of 4 subprojects. splashactivity & mainactivity in same subproject.
i've spent countless hours on this. tried: clean, rebuild, invalidate cache , restart - nothing helped. can advise how stop nightmare? many in advance !
may use intent filter:
<intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter>
if package name is: (may com.androidcore.android
? - please check)
com.androidcore.android.main
then use name: (if package name com.androidcore.android
use .main.mainactivity
)
android:name=".mainactivity"
actually best name package domain reverse:
com.yourdomain.yourprojectname
keep in memory cool )
Comments
Post a Comment