问题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'//最新版本
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。