alibaba / fastjson2

🚄 FASTJSON2 is a Java JSON library with excellent performance.
Apache License 2.0
3.79k stars 495 forks source link

[BUG] FastJSON2 Android依赖2.0.53版本编译不通过 #3142

Open huannan opened 2 weeks ago

huannan commented 2 weeks ago

问题描述

编译不通过

环境信息

请填写以下信息:

重现步骤

如何操作可以重现该问题:

  1. Android依赖2.0.53
  2. 编译
  3. 出现 FAILED 错误
versions.fastjson2 = '2.0.53'
ext.versions = versions

implementation("com.alibaba.fastjson2:fastjson2:${versions.fastjson2}")
implementation("com.alibaba.fastjson2:fastjson2-extension:${versions.fastjson2}")

期待的正确结果

希望编译通过

相关日志输出

> Task :app:dexBuilderDebug FAILED
AGPBI: {"kind":"error","text":"java.lang.NullPointerException","sources":[{"file":"/Users/wuhuannan/.gradle/caches/transforms-3/5763dc353529590d4989d38609443ca3/transformed/jetified-fastjson2-extension-2.0.53.jar"}],"tool":"D8"}
AGPBI: {"kind":"error","text":"java.lang.NullPointerException","sources":[{"file":"/Users/wuhuannan/.gradle/caches/transforms-3/e91b484264d5939860b90136a59dc7af/transformed/jetified-fastjson2-2.0.53.jar"}],"tool":"D8"}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:dexBuilderDebug'.
> Could not resolve all files for configuration ':app:detachedConfiguration18'.
   > Failed to transform jetified-fastjson2-extension-2.0.53.jar to match attributes {artifactType=ext-dex-dexBuilderDebug, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for DexingExternalLibArtifactTransform: /Users/wuhuannan/.gradle/caches/transforms-3/5763dc353529590d4989d38609443ca3/transformed/jetified-fastjson2-extension-2.0.53.jar.
         > Error while dexing.
   > Failed to transform jetified-fastjson2-2.0.53.jar to match attributes {artifactType=ext-dex-dexBuilderDebug, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for DexingExternalLibArtifactTransform: /Users/wuhuannan/.gradle/caches/transforms-3/e91b484264d5939860b90136a59dc7af/transformed/jetified-fastjson2-2.0.53.jar.
         > Error while dexing.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 12s
109 actionable tasks: 15 executed, 94 up-to-date
wenshao commented 2 weeks ago

看不出错误原因,你是否可以帮忙诊断下。你为什么不用2.0.53.android8版本?