我正在将React Native集成到Android项目中,并且遇到了这个问题。


Module 'com.facebook.stetho:stetho-okhttp:1.2.0' depends on one or more Android Libraries but is a jar
Module 'com.facebook.stetho:stetho-okhttp:1.2.0' depends on one or more Android Libraries but is a jar

 FAILED
:uscs_core_mobile:buildInfoGeneratorE3PRODLogsDebug

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':uscs_core_mobile:prepareE3PRODLogsDebugDependencies'.
> Dependency Error. See console for details.

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

BUILD FAILED

注意:以上是使用--stacktrace运行后看到的内容

当我检查我的应用程序时,实际上并没有看到stetho-okhttp:1.2.0,而是看到了stetho:1.4.1

有没有人经历过或有想法?

最佳答案

解决了!您需要从gradle中排除stetho。查看issue comments

添加到依赖项:

compile ("com.facebook.react:react-native:+") {
    exclude group:'com.facebook.stetho', module:'stetho'
  }

此外,Stetho也已从Android库中删除。
文章
why is was removed and how to start using it again

08-18 04:41