Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolving dependency configuration 'implementation' is not allowed as it is defined as 'canBeResolved=false'

I am trying to run a react native project but its gradle is not working correctly. This is the error.

org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':babylonjs_react-native'.
Caused by: java.lang.IllegalStateException: Resolving dependency configuration 'implementation' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'implementation' should be resolved.
    at build_8wyks54mb6cye9xs3jcg9t1xg$_run_closure4$_closure12.doCall(G:\Workspace\New Folder (2)\node_modules\@babylonjs\react-native\android\build.gradle:117)
    at build_8wyks54mb6cye9xs3jcg9t1xg$_run_closure4.doCall(G:\Workspace\New Folder (2)\node_modules\@babylonjs\react-native\android\build.gradle:114)

Here is where the problem occurs

afterEvaluate { project ->
    // some Gradle build hooks ref:
    // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
    task androidJavadoc(type: Javadoc) {
        source = android.sourceSets.main.java.srcDirs
        classpath += files(android.bootClasspath)
        classpath += files(project.getConfigurations().getByName('implementation').asList())
        include '**/*.java'
    }

Kindly Somebody tells me why is the error showing I dont have any idea what is going on. Somebody please help me I will be very thankful.

like image 993
Ishaq Kamran Avatar asked Nov 15 '22 19:11

Ishaq Kamran


1 Answers

You should use the code this below:

classpath += files(configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) })

That may helpful for you.

like image 186
Squid233 Avatar answered Dec 16 '22 02:12

Squid233