I'm trying to open a source code of Plumble , I changed gradle wrapper distributionUrl to 4.4 and then this gradle error appeared
tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs }
I searched and figured out in gradle 4.4 "Compile" is undefined and I have to use JavaCompiler instead but then this error appeared
Could not find method jniDir() for arguments [C:\Users\NP\Desktop\Plumble-Legacy-master\build\native-libs] on task ':packageDebug' of type com.android.build.gradle.tasks.PackageApplication.
so I replaced
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniDir new File(buildDir, 'native-libs')
}
to
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniFolders = new HashSet<File>()
pkgTask.jniFolders.add(new File(projectDir, 'native-libs'))
}
but now there is a new error in gradle building :
Cannot cast object '[]' with class 'java.util.HashSet' to class 'org.gradle.api.file.FileCollection' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.gradle.api.file.FileCollection()
does anybody know how can I fix this? any help will be much appreciated
Even I faced the issue. The solution that worked for me is 1) Update the build script with the exact maven repo url. 2) add apply plugin : maven to the script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With