Activity Class cannot be found in AAR file java.lang.NoClassDefFoundError

后端 未结 6 2188
暖寄归人
暖寄归人 2021-01-04 01:54

I have created an android library, it contains an Activity Class that uses to open camera intent, the library works perfect excepts for the part that invokes the Activity to

6条回答
  •  無奈伤痛
    2021-01-04 02:40

    The cause of the problem is that the class ScannerViewActivity is called inside one of your AAR as a dependency like:

    apply plugin: 'com.android.library'
    android{...}
    dependencies {
        compile 'com.me.scanner:otherscanner@aar' //library which contains ScannerViewActivity
    }
    

    but when you use a aar (transitive won't add this aar dependencies !), you have to add the other dependency such as:

    dependencies {
    ...
    compile ('com.me.app:scanner@aar')// remove{ transitive = true; }
    compile ('com.me.scanner:otherscanner@aar')
    ...
    }
    

提交回复
热议问题