反应原生 trustkit 依赖:找不到 com.datatheorem.truskit:trustkit-android

Posted

技术标签:

【中文标题】反应原生 trustkit 依赖:找不到 com.datatheorem.truskit:trustkit-android【英文标题】:react native trustkit dependency: could not find com.datatheorem.truskit:trustkit-android 【发布时间】:2020-06-02 10:53:37 【问题描述】:

我正在按照本指南设置 trustkit SSL pinngin: https://github.com/datatheorem/TrustKit-android

我在尝试安装信任工具包依赖项时遇到错误

我的 build.gradle 看起来像这样

dependencies 
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation 'com.datatheorem.truskit:trustkit-android:1.1.3'

    if (enableHermes) 
      def hermesPath = "../../node_modules/hermesvm/android/";
      debugImplementation files(hermesPath + "hermes-debug.aar")
      releaseImplementation files(hermesPath + "hermes-release.aar")
     else 
      implementation jscFlavor
    

错误:

 Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.datatheorem.truskit:trustkit-android:1.1.3.
     Searched in the following locations:
       - file:/Users/omar/.m2/repository/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
       - file:/Users/omar/.m2/repository/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
       - file:/Users/omar/workspace/js/contextful/node_modules/react-native/android/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
       - file:/Users/omar/workspace/js/contextful/node_modules/react-native/android/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
       - file:/Users/omar/workspace/js/contextful/node_modules/jsc-android/dist/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
       - file:/Users/omar/workspace/js/contextful/node_modules/jsc-android/dist/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
       - https://www.jitpack.io/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
       - https://www.jitpack.io/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
       - https://maven.google.com/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
       - https://maven.google.com/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
       - https://dl.google.com/dl/android/maven2/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
       - https://dl.google.com/dl/android/maven2/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
       - https://jcenter.bintray.com/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
       - https://jcenter.bintray.com/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
     Required by:
         project :app

【问题讨论】:

你为什么不回复我? 很抱歉超忙需要2天 【参考方案1】:

解决方案:

使用这样的实现Docs

implementation 'com.datatheorem.android.trustkit:trustkit:1.1.3'

我已经测试过。它正在工作

-

问题:

不要使用下面的依赖,因为它不存在

implementation 'com.datatheorem.truskit:trustkit-android:1.1.3'

【讨论】:

以上是关于反应原生 trustkit 依赖:找不到 com.datatheorem.truskit:trustkit-android的主要内容,如果未能解决你的问题,请参考以下文章

ld:在 Xcode 中找不到 -lFirebaseCore 的库反应原生

使用 Yarn 或 NPM 进行原生反应找不到 @expo/bunyan。我必须做啥?

不变违规:requireNativeComponent:在反应原生的 UIManager 中找不到“FastImageView”

不变违规:requireNativeComponent:在 UIManager 中找不到“RNCSafeAreaView”。在 expo 应用程序中反应原生

找不到“React / RCTDefines.h”文件。在反应原生推送通知集成中

反应原生地图聚类