Closed yanshouwang closed 2 months ago
9999.0 is just a trick that Guava has used for pre-27 to avoid a duplicate class error. See https://mvnrepository.com/artifact/com.google.guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava
Please provide your dependencies inside your build.gradle
.
9999.0 is just a trick that Guava has used for pre-27 to avoid a duplicate class error. See https://mvnrepository.com/artifact/com.google.guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava
Please provide your dependencies inside your
build.gradle
.
Here is my dependencies
buildscript {
ext.kotlin_version = "1.7.10"
ext.camerax_version = "1.3.4"
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}
...
dependencies {
// The following line is optional, as the core library is included indirectly by camera-camera2
api "androidx.camera:camera-core:${camerax_version}"
api "androidx.camera:camera-camera2:${camerax_version}"
// If you want to additionally use the CameraX Lifecycle library
api "androidx.camera:camera-lifecycle:${camerax_version}"
// If you want to additionally use the CameraX VideoCapture library
//api "androidx.camera:camera-video:${camerax_version}"
// If you want to additionally use the CameraX View class
api "androidx.camera:camera-view:${camerax_version}"
// If you want to additionally add CameraX ML Kit Vision Integration
//api "androidx.camera:camera-mlkit-vision:${camerax_version}"
// If you want to additionally use the CameraX Extensions library
//api "androidx.camera:camera-extensions:${camerax_version}"
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.mockito:mockito-core:5.0.0")
}
I can't fix this even if I add the listenablefuture:1.0 as a dependency manually.
Haha. There is an entire blog post about this: https://blog.gradle.org/guava
androidx.concurrent:concurrent-futures
depends on the library's 1.0, as you don't have any guava dependencies, it's odd to see 9999 being picked up by gradle.
Any changes you make need to be followed by a flutter clean
+ flutter build apk
in the example
directory.
It's out of jnigen's scope to fix gradle problems, so I would simply copy the jar to the code directory and use its path for class_path
.
so I would simply copy the jar to the cod
I see, I have no idea why the 9999.0 is resolved, but as I can fix this by declare the real class_path, just close this :wink:
When I generate JNI bindings for
CameraX
today earlier. I found an error withListenableFuture
class.The
jnigen.yaml
is like this.After run the command I got this error:
I notice that JNIGEN use wrong class path with
C:\Users\yanshouwang\.gradle\caches\transforms-3\03f7c26f446d76cca35cfdf739539d39\transformed\jetified-listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
I can fix this error by declare the real class path in jnigen.yaml