AesSedai101
AesSedai101

Reputation: 1533

Android ClassNotFoundException, class is in APK

I am getting the following error when running an Android app on an emulator:

I/dalvikvm( 2560): Failed resolving Lorg/jacoco/agent/rt/internal_e6e56f0/CoverageTransformer; interface 6277 'Ljava/lang/instrument/ClassFileTransformer;'
W/dalvikvm( 2560): Link of class 'Lorg/jacoco/agent/rt/internal_e6e56f0/CoverageTransformer;' failed
W/ClassPathPackageInfoSource( 2560): Cannot load class. Make sure it is in your apk. Class name: 'org.jacoco.agent.rt.internal_e6e56f0.CoverageTransformer'. Message: org.jacoco.agent.rt.internal_e6e56f0.CoverageTransformer
W/ClassPathPackageInfoSource( 2560): java.lang.ClassNotFoundException: org.jacoco.agent.rt.internal_e6e56f0.CoverageTransformer
W/ClassPathPackageInfoSource( 2560):    at java.lang.Class.classForName(Native Method)
W/ClassPathPackageInfoSource( 2560):    at java.lang.Class.forName(Class.java:217)
W/ClassPathPackageInfoSource( 2560):    at android.test.ClassPathPackageInfoSource.createPackageInfo(ClassPathPackageInfoSource.java:88)
W/ClassPathPackageInfoSource( 2560):    at android.test.ClassPathPackageInfoSource.access$000(ClassPathPackageInfoSource.java:39)
W/ClassPathPackageInfoSource( 2560):    at android.test.ClassPathPackageInfoSource$1.load(ClassPathPackageInfoSource.java:50)
W/ClassPathPackageInfoSource( 2560):    at android.test.ClassPathPackageInfoSource$1.load(ClassPathPackageInfoSource.java:47)
W/ClassPathPackageInfoSource( 2560):    at android.test.SimpleCache.get(SimpleCache.java:31)
W/ClassPathPackageInfoSource( 2560):    at android.test.ClassPathPackageInfoSource.getPackageInfo(ClassPathPackageInfoSource.java:72)
W/ClassPathPackageInfoSource( 2560):    at android.test.ClassPathPackageInfo.getSubpackages(ClassPathPackageInfo.java:48)
W/ClassPathPackageInfoSource( 2560):    at android.test.ClassPathPackageInfo.addTopLevelClassesTo(ClassPathPackageInfo.java:61)
W/ClassPathPackageInfoSource( 2560):    at android.test.ClassPathPackageInfo.getTopLevelClassesRecursive(ClassPathPackageInfo.java:55)
W/ClassPathPackageInfoSource( 2560):    at android.test.suitebuilder.TestGrouping.testCaseClassesInPackage(TestGrouping.java:156)
W/ClassPathPackageInfoSource( 2560):    at android.test.suitebuilder.TestGrouping.addPackagesRecursive(TestGrouping.java:117)
W/ClassPathPackageInfoSource( 2560):    at android.test.suitebuilder.TestSuiteBuilder.includePackages(TestSuiteBuilder.java:102)
W/ClassPathPackageInfoSource( 2560):    at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:366)
W/ClassPathPackageInfoSource( 2560):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4142)
W/ClassPathPackageInfoSource( 2560):    at android.app.ActivityThread.access$1300(ActivityThread.java:130)
W/ClassPathPackageInfoSource( 2560):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
W/ClassPathPackageInfoSource( 2560):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/ClassPathPackageInfoSource( 2560):    at android.os.Looper.loop(Looper.java:137)
W/ClassPathPackageInfoSource( 2560):    at android.app.ActivityThread.main(ActivityThread.java:4745)
W/ClassPathPackageInfoSource( 2560):    at java.lang.reflect.Method.invokeNative(Native Method)
W/ClassPathPackageInfoSource( 2560):    at java.lang.reflect.Method.invoke(Method.java:511)
W/ClassPathPackageInfoSource( 2560):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
W/ClassPathPackageInfoSource( 2560):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
W/ClassPathPackageInfoSource( 2560):    at dalvik.system.NativeStart.main(Native Method)
W/ClassPathPackageInfoSource( 2560): Caused by: java.lang.NoClassDefFoundError: org/jacoco/agent/rt/internal_e6e56f0/CoverageTransformer
W/ClassPathPackageInfoSource( 2560):    ... 26 more
W/ClassPathPackageInfoSource( 2560): Caused by: java.lang.ClassNotFoundException: org.jacoco.agent.rt.internal_e6e56f0.CoverageTransformer
W/ClassPathPackageInfoSource( 2560):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
W/ClassPathPackageInfoSource( 2560):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
W/ClassPathPackageInfoSource( 2560):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
W/ClassPathPackageInfoSource( 2560):    ... 26 more

The obvious solution is that the dependency is not being included. However, I do have the maven dependency in my pom (scope: compile). I even went as far as to decompile the source: the class in question is in my APK.

Thanks.

Upvotes: 1

Views: 705

Answers (1)

G. Blake Meike
G. Blake Meike

Reputation: 6715

This looks similar to an issue I just ran into. You are not running the app, you are testing it, right? If so, and if your tests are running, you can ignore these messages. See the discussion here

Upvotes: 1

Related Questions