Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager. #178

Open
paulayo93 opened this issue Mar 15, 2023 · 5 comments

Comments

@paulayo93
Copy link
Contributor

I am getting this error when I run the command: npm run android

I have tried compiling with different SDK but still doesn't work. Also, on uninstalling the Build Tools Version 31.0.0 the error still persist

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':react-native-qr-decode-image-camera:compileDebugAidl'.
> Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

OS Spec

MacBook Pro
Intel Core i9
macOS Ventura
NodeJs - 14.17.0

@aguycalled
Copy link
Member

I've just did a fresh clone of the repo, npm i --force and npm run android, It worked.

MBPro M1 / Ventura / node v16.13.2 / Android Studio 2021.3.1

Emulator running a Nexus 7 (2012) API 31

May I have more details about your setup? Can you try reinstalling the build tools through the sdk manager as suggested in the exception message?

@paulayo93
Copy link
Contributor Author

Thanks, @aguycalled so sorry I did not mention that I got it working with some hacks, but I still doubt it. I will appreciate your help immensely!

Yes, I did try to install from the terminal and SDK tools, none of it worked.

Based on the error posted above, I used this solution:

cd ~/Library/Android/sdk/build-tools/31.0.0 && mv d8 dx && cd lib && mv d8.jar dx.jar

Also, I got another error with reanimated and expo-modules, which I resolved by adding this to android/build.gradle file:

allprojects {
    repositories {
        exclusiveContent {
           filter {
               includeGroup "com.facebook.react"
           }
           forRepository {
               maven {
                   url "$rootDir/../node_modules/react-native/android"
               }
           }
       }

       // ... your repository definitions

    }
}

So, this is what my android/build.gradle file looks like now:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 23
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "21.4.7075529"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.2")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
         exclusiveContent {
           filter {
               includeGroup "com.facebook.react"
           }
           forRepository {
               maven {
                   url "$rootDir/../node_modules/react-native/android"
               }
           }
       }
        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://www.jitpack.io' }
    }
}


Works on:

  • Emulator running on Pixel 4 (Android 11.0) API 30
  • Emulator running on Pixel 4 (Android 12.0) API 31

Android Studio 2022.1.1

Thanks for the help.

@paulayo93 paulayo93 reopened this Mar 19, 2023
@aguycalled
Copy link
Member

thanks, I will test and add your patch to android/build.gradle ;)

about the sdk issue, it seems related to your local sdk environment, since a fresh repo clone works for me. I am not sure if I'd be able to help about it

@paulayo93
Copy link
Contributor Author

Thanks for the response @aguycalled

@paulayo93
Copy link
Contributor Author

@aguycalled can this issue be closed now or left open until you test and add a patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants