./gradlew assembleRelease 构建失败,找不到 com.linkedin.dexmaker:dexmaker:2.21.0

./gradlew assembleRelease BUILD FAILED with Could not find com.linkedin.dexmaker:dexmaker:2.21.0

这是一个带有 expo 裸工作流程的 react-native 项目。
./gradlew assembleDebug 正常工作,我可以 运行 应用程序。

但是 ./gradlew assembleRelease 构建失败,输出如下:

Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':expo-json-utils:debugAndroidTestRuntimeClasspath'.
   > Could not find com.linkedin.dexmaker:dexmaker:2.21.0.
     Searched in the following locations:
       - file:/Users/<MY USERNAME>/.m2/repository/com/linkedin/dexmaker/dexmaker/2.21.0/dexmaker-2.21.0.pom
       - file:/Users/<MY PROJECT PATH>/node_modules/react-native/android/com/linkedin/dexmaker/dexmaker/2.21.0/dexmaker-2.21.0.pom
       - file:/Users/<MY PROJECT PATH>/node_modules/jsc-android/dist/com/linkedin/dexmaker/dexmaker/2.21.0/dexmaker-2.21.0.pom
       - https://dl.google.com/dl/android/maven2/com/linkedin/dexmaker/dexmaker/2.21.0/dexmaker-2.21.0.pom
       - https://repo.maven.apache.org/maven2/com/linkedin/dexmaker/dexmaker/2.21.0/dexmaker-2.21.0.pom
       - https://www.jitpack.io/com/linkedin/dexmaker/dexmaker/2.21.0/dexmaker-2.21.0.pom
     Required by:
         project :expo-json-utils > io.mockk:mockk-android:1.10.6 > io.mockk:mockk-agent-android:1.10.6

expo-json-utils 未在 package.json 依赖项中列出,因此它必须是其中一个包的子依赖项。
jcenter() 添加到 android/build.gradle 并不能解决问题。

有什么想法可以使用哪个包 expo-json-utils 或者如何解决这个问题?

有 2 个问题。

  1. 最近更新了 Expo 和相关包,这些行仍在 android/app/build.gradle:
apply from: "../../node_modules/expo-constants/scripts/get-app-config-android.gradle"
apply from: "../../node_modules/expo-updates/scripts/create-manifest-android.gradle"

它们应该被删除。

  1. 仍然需要将 jcenter() 添加到 android/build.gradle 文件的部分:
allprojects {
    repositories {

看起来只有最新版本 2.28.1 添加到 maven central: https://mvnrepository.com/artifact/com.linkedin.dexmaker/dexmaker-mockito

旧版本在 jcenter 中,来自 expo-json-utils@0.2.0 的传递依赖版本是 2.21.0