【发布时间】:2022-06-21 05:06:53
【问题描述】:
这是一个带有 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 或者如何解决这个问题?
【问题讨论】:
-
我假设您已经尝试过,但可能会尝试删除 node_modules 文件夹并运行 npm i --save 以重新安装。很多时候,这为我解决了任何类似的问题。此外,在重新安装包后,在 Android Studio 中清理并重新构建项目,然后运行 assembleRelease 会有所帮助。
-
@AleksandarZoric,是的,我试过了,没有帮助...
标签: android react-native expo release