无法确定任务':react-native-ssl-pinning:bundleLibCompileToJarDebug'的依赖关系

问题描述 投票:0回答:1

我在 React Native 中运行 Android 应用程序时遇到了 react-native-ssl-pinning 库的问题。虽然它在 iOS 中工作得很好,但在 Android 中却无法构建,并出现以下错误:

sql 复制代码 失败:构建失败并出现异常。

  • 出了什么问题:
Could not determine the dependencies of task ':react-native-ssl-pinning:bundleLibCompileToJarDebug'.
> Could not create task ':react-native-ssl-pinning:compileDebugJavaWithJavac'.

我尝试通过手动链接库来解决此问题。这是我迄今为止尝试过的:

手动链接:由于react-native链接不起作用,我尝试了手动链接。以下是我在 Android 上遵循的步骤:

在 android/settings.gradle 中,我添加了以下几行:

include ':react-native-ssl-pinning'
project(':react-native-ssl-pinning').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ssl-pinning/android')

在 android/app/build.gradle 中,我在依赖项中添加了以下行:

implementation project(':react-native-ssl-pinning')

在 MainApplication.java 中,我在文件顶部添加了以下导入语句:

import com.toyberman.RNSslPinningPackage;

然后将新的 RNSslPinningPackage() 添加到 getPackages() 方法返回的列表中。

不幸的是,尽管采取了这些步骤,我仍然遇到同样的错误。任何有关如何解决此问题的见解或建议将不胜感激!

android react-native ssl axios
1个回答
0
投票

我也遇到同样的问题,请问你解决了吗?

© www.soinside.com 2019 - 2024. All rights reserved.