Error: could not find or load the main class org.gradle.wrapper.GradleWrapperMain

I am responding to the native version 0.42.0. My project did a great job with this.

Recently, I upgraded to version 0.43.1. and now when i do

react-native run-android

I am stuck with an error.

JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.imtqy.com/react-native/docs/android-setup.html

I followed the upgrade instructions from https://facebook.imtqy.com/react-native/docs/upgrading.html

I was looking for this problem. Went through the following links, none of them worked for me.

Any help / guidance would be helpful to me.

+11
6

, < gradle -wrapper.jar gradle/wrapper.

, , .

gradle -wrapper.properties *distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip, gradle .

+8
react-native upgrade

. . , Android iOS , .

+8
  1. gradle-wrapper.jar ~\android\gradle\wrapper, jar 49

  2. gradle-wrapper.properties distributionUrl = https://services.gradle.org/distributions/gradle-2.10-all.zip

  3. (: Wrapper) {gradleVersion = '2.10'} build.gradle

  4. , react-native run-android. :

     * What went wrong: Execution failed for task ':app:mergeDebugResources'.
     > Some file crunching failed, see logs for details ,
    

    , build.gradle :

    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.1"
    
        aaptOptions {
            cruncherEnabled = false
            useNewCruncher = false
        }
    
+2

, :

1) Android iOS

2)

react-native eject

3) !

react-native run-android
+2

, react-native upgrade gradle-wrapper.jar. , (n) .

0

, gradle. , gradle, gradle.

, . https://gradle.org/install/#manually

0

Source: https://habr.com/ru/post/1016655/


All Articles