android - java.lang.NoClassDefFoundError at Runtime in Activity's inner class -
i have found lot of similar questions, no 1 helps me.
i have next problem. have complete project android , have export it's functionality .aar
library. first of created new project , created new module put source project. @ step things goes , mylib.aar
file in /build/outputs/aar/
folder. created new project test mylib.aar
, created libs
folder under app
folder in android studio, , in build.gradle
file of test project added these lines:
repositories { flatdir {dirs 'libs'} } dependencies { compile(name: 'mylib', ext: 'aar') }
in manifest file added declaration of mainactivity library:
<activity android:name="com.testlib.mylib.mainactivity" android:label="mainactivity"/>
android studio found file , can watch source code through built-in decompiler. when try start activity activity isn't placed in lib error:
3838-3838/com.testapp.testsdkapp e/androidruntime﹕ fatal exception: main process: com.testapp.testsdkapp, pid: 3838 java.lang.noclassdeffounderror: com.testlib.mylib.mainactivity$registerinbackgroundtask @ com.testlib.mylib.mainactivity.registerinbackground(mainactivity.java:1551) @ com.testlib.mylib.mainactivity.oncreate(mainactivity.java:269) @ android.app.activity.performcreate(activity.java:5937) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1105) @ android.app.activitythread.performlaunchactivity(activitythread.java:2251) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2360) @ android.app.activitythread.access$800(activitythread.java:144) @ android.app.activitythread$h.handlemessage(activitythread.java:1278) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5221) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:899) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:694)
registerinbackgroundtask
inner public asynctask
class declared in mainactivity in library. tried put mylib.aar
in aar
folder , declare in build.gradle
in other way, didn't me , similar error.
if information not enough, i'll add required parts of code etc. please me, if know how solve problem! thanks.
import mylib.aar module in project , inside dependencies add following line
compile project(':mylib')
Comments
Post a Comment