當我建立一個* .aar文件而不是用搖籃4.x的模塊的應用程序,以下關於實現和API的docu,我期望使用api所包含的aar文件包含所有依賴項,但它沒有。使用的AAR圖書館事業缺少搖籃4.x中使用API的依賴
當你
git clone https://github.com/hannesa2/aar_dependency
./gradlew clean assembleDebug
意味着
dependencies {
api project(':mylibrary')
它工作正常。
但是當我使用insted的LIB-模塊的前面生成的* .aar文件作爲依賴
dependencies {
api 'com.example.my.mylibrary:[email protected]'
(在demo app只是做)
git checkout with_aar
./gradlew clean assembleDebug
我碰上這種
任務:app:transformClassesWithDesugarForDebug 線程「main」中的異常java.lang.TypeNotPresentE xception:類型io.reactivex.ObservableTransformer不存在 at sun.invoke.util.BytecodeDescriptor.parseSig(BytecodeDescriptor.java:85) at sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:63) at sun。 invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:41) at java.lang.invoke.MethodType.fromMethodDescriptorString(MethodType.java:1067) at com.google.devtools.build.android.desugar.LambdaDesugaring $ InvokedynamicRewriter。 visitInvokeDynamicInsn(LambdaDesugaring.java:399) 在org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(未知來源) 在org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(未知來源)
因爲我普通遇到這種情況,將AAR文物上傳到我們公司的Maven Nexus中,我創建了這個demo-repo以顯示出什麼是錯誤的。在演示應用程序或使用Maven我看到同樣的問題。
有人知道我做錯了什麼嗎?
AAR的文件**好好嘗試一下包含**的傳遞依賴。發佈它在maven回購 –
我的aar使用例如。 RxJava,這個RxJava已經在另一個maven中了。 所以我想你的建議「發佈在一個maven回購」被實現,或者我錯了嗎? aar消費者有沒有辦法使用它,而無需處理例如RxJava依賴項? –