Trying to build the android app made by ReactNative, I faced following error:
* What went wrong:A problem occurred configuring project ':iamport-react-native'.> Could not resolve all artifacts for configuration ':iamport-react-native:classpath'.> Could not find com.android.tools.build:gradle:3.6.3. Searched in the following locations: - https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.3/gradle-3.6.3.pom - https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.3/gradle-3.6.3.jar Required by: project :iamport-react-native
This app is work well in other environment. But when I trying to build it in new environment, the above error come up. (The new environment means the new PC and new version of Android Studio. etc.) The following is the new environment.
- jdk (the only thing that is same with previous environment)
java 12.0.2 2019-07-16Java(TM) SE Runtime Environment (build 12.0.2+10)Java HotSpot(TM) 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
- build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { ext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 } repositories { mavenCentral() google() jcenter() } dependencies { classpath('com.android.tools.build:gradle:3.6.0') // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } google() jcenter() maven { url 'https://jitpack.io' } }}
- gradle.properties
distributionBase=GRADLE_USER_HOMEdistributionPath=wrapper/distszipStoreBase=GRADLE_USER_HOMEzipStorePath=wrapper/distsdistributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
- Compile Sdk Version for moduleiamport-react-native
28 (API 28: Android 9.0(Pie))
- Build Tools Version for moduleiamport-react-native
28.0.3
Although searching and applying many ways, I couldn't resolve this error. The big problem is that I do not know what is the problem exactly.
So, how can I fix it and build successfully?