gpt4 book ai didi

androidX jetifier - 有没有办法忽略 jetifying .JAR?

转载 作者:搜寻专家 更新时间:2023-11-01 08:18:11 26 4
gpt4 key购买 nike

尝试将我的应用程序更新为 androidX 依赖项。按照说明 here ,编译失败。错误来自 JetifyTransform 任务未能处理某个 .JAR 依赖项(仅供引用 - Samsungs Spass SDK):

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptGenerateStubsStandardNo_vendorDebugKotlin'.
> Could not resolve all artifacts for configuration ':app:standardNo_vendorDebugCompileClasspath'.
> Failed to transform file 'pass-v1.2.2.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
> Failed to transform '/Users/hanandann/StudioProjects/ArnakPaymentsAndroid/Payments/app/libs/pass-v1.2.2.jar' using Jetifier. Reason: null. (Run with --stacktrace for more details.)
> Failed to transform file 'pass-v1.2.2.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
> Failed to transform '/Users/hanandann/StudioProjects/ArnakPaymentsAndroid/Payments/app/libs/pass-v1.2.2.jar' using Jetifier. Reason: null. (Run with --stacktrace for more details.)

尝试使用 jetifier-standalone 工具进行 jetify 有类似的结果:

Hanans-MacBook-Pro:bin hanandann$ ./jetifier-standalone -i /Users/hanandann/StudioProjects/.../app/libs/pass-v1.2.2.jar -o /Users/hanandann/StudioProjects/.../app/libs/pass-v1.2.2jet.jar 
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
at org.objectweb.asm.ClassReader.readFrameType(ClassReader.java:2313)
at org.objectweb.asm.ClassReader.readFrame(ClassReader.java:2269)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1448)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:698)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.android.tools.build.jetifier.processor.transform.bytecode.ByteCodeTransformer.runTransform(ByteCodeTransformer.kt:39)
at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:443)
at com.android.tools.build.jetifier.processor.archive.ArchiveFile.accept(ArchiveFile.kt:49)
at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:425)
at com.android.tools.build.jetifier.processor.archive.Archive.accept(Archive.kt:76)
at com.android.tools.build.jetifier.processor.Processor.transformLibrary(Processor.kt:421)
at com.android.tools.build.jetifier.processor.Processor.transform(Processor.kt:247)
at com.android.tools.build.jetifier.processor.Processor.transform$default(Processor.kt:234)
at com.android.tools.build.jetifier.standalone.Main.run(Main.kt:157)
at com.android.tools.build.jetifier.standalone.Main$Companion.main(Main.kt:109)
at com.android.tools.build.jetifier.standalone.Main.main(Main.kt)

现在,我真的不介意 SDK 是否未被 Jetified,所以我尝试在我的 gradle.properties 文件中设置 android.enableJetifier=false,但是由于不同的原因,编译再次失败 - SupportMapFragment 与 androidX 不兼容,据报道 here

所以我卡住了。使用 jetify .JAR 不会转换。与它 - SupportMapFarg 不兼容。

有什么建议吗?

附言你知道什么会很好吗? jetifying 函数是否有 ignore 选项

最佳答案

将此添加到 gradle.properties:

android.jetifier.blacklist = pass

正如谷歌人员所建议的那样 here .

请注意 - 此功能是实验性的,不受支持。


更新当前语法是 android.jetifier.ignorelist={your.ignored.lib} @YaMiN 建议

关于androidX jetifier - 有没有办法忽略 jetifying .JAR?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55813882/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com