React-native 集成react-native-puti-pay 爬坑

44次阅读

共计 2345 个字符,预计需要花费 6 分钟才能阅读完成。

问题 1: 按照官网后运行正常,第二次运行突然报错,让人措手不及
WARNING: The specified Android SDK Build Tools version (28.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.2.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove “buildToolsVersion ‘28.0.2’” from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:checkDebugClasspath FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ‘:app:debugCompileClasspath’.
> Could not resolve com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+.
Required by:
project :app > project :react-native-puti-pay
> Failed to list versions for com.tencent.mm.opensdk:wechat-sdk-android-without-mta.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/tencent/mm/opensdk/wechat-sdk-android-without-mta/maven-metadata.xml.
> Could not HEAD ‘https://jcenter.bintray.com/com/tencent/mm/opensdk/wechat-sdk-android-without-mta/maven-metadata.xml’.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Failed to list versions for com.tencent.mm.opensdk:wechat-sdk-android-without-mta.
> Unable to load Maven meta-data from https://dl.google.com/dl/android/maven2/com/tencent/mm/opensdk/wechat-sdk-android-without-mta/maven-metadata.xml.
> Could not get resource ‘https://dl.google.com/dl/android/maven2/com/tencent/mm/opensdk/wechat-sdk-android-without-mta/maven-metadata.xml’.
> Could not GET ‘https://dl.google.com/dl/android/maven2/com/tencent/mm/opensdk/wechat-sdk-android-without-mta/maven-metadata.xml’.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Failed to list versions for com.tencent.mm.opensdk:wechat-sdk-android-without-mta.
> Unable to load Maven meta-data from https://maven.google.com/com/tencent/mm/opensdk/wechat-sdk-android-without-mta/maven-metadata.xml.
> Could not get resource ‘https://maven.goo
解决办法修改 react-native-puti-pay 下 android 目录的 build.gradle 文件,指明明确的版本号;https://bintray.com/wechat-sd…,可以查看到 wechat-sdk 的最新版本号,指定为最新版本号,就 gradle 就成功 sync 了
// 将
compile ‘com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+’
// 里面的加号修改成微信 sdk 的最新版本
compile ‘com.tencent.mm.opensdk:wechat-sdk-android-without-mta:5.3.1’// 最新版本

正文完
 0