React-native 集成react-native-yunpeng-alipay 爬坑

发布时间:2019-08-05 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了React-native 集成react-native-yunpeng-alipay 爬坑脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

问题1:按照官网添加link后运行报错

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-yunpeng-alipay'.
> Could not resolve all artifacts for configuration ':react-native-yunpeng-alipay:classpath'.
   > Could not resolve com.android.tools.build:gradle:1.3.1.
     Required by:
         project :react-native-yunpeng-alipay
      > Could not resolve com.android.tools.build:gradle:1.3.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.android.tools.build:gradle:1.3.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

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

解决办法
修改react-native-yunpeng-alipay下的build.gradle文件

buildscript {
  repositories {
      mavenLocal()
      google()
      jcenter()
  }

  dependencies {
    // classpath 'com.android.tools.build:gradle:1.3.1'
     classpath 'com.android.tools.build:gradle:3.2.1'
  }
}

修改com.android.tools.build:gradle:1.3.1和项目android的版本保持一致
添加 mavenLocal() google()
重新运行 ,问题解决

脚本宝典总结

以上是脚本宝典为你收集整理的React-native 集成react-native-yunpeng-alipay 爬坑全部内容,希望文章能够帮你解决React-native 集成react-native-yunpeng-alipay 爬坑所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。