Configuration with name 'compile' not found in React Native project with Auth0

Viewed 847

Ever since I connected a physical device to my computer to test my React Native project, I started having this problem. Prior to the physical device, the same code with no changes whatsoever worked fine on my computer and I was able to install and test it to the Android simulator.

Now, I constantly get the following error and the app fails to build. The error is:

A problem occurred configuring project ':react-native-auth0'.

Configuration with name 'compile' not found.

And the error is pointing to the \node_modules\react-native-auth0\android\build.gradle file with the following code:

task androidJavadoc(type: Javadoc) {
        source = android.sourceSets.main.java.srcDirs
        classpath += files(android.bootClasspath)
        classpath += files(project.getConfigurations().getByName('compile').asList()) // <-- The error is pointing to this line
        include '**/*.java'
    }

As I said, everything was working fine on my laptop using the Android simulator. Ever since connecting and configuring the physical device, I can no longer even build the project.

Any idea what the problem is and how to fix it?

1 Answers

Add the following lines to your android/build.gradle file

subprojects { subproject ->
        if(project['name'] == 'react-native-reanimated'){
            project.configurations { compile { } }
        }
}
Related