-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Duplicated files copied in APK #353
Comments
Not sure, why are you getting duplicates? What does your build file looks like? |
I'm adding them with gradle as follows:
I know its outdated and plan to upgrade to 1.0 as soon as possible. |
Yeah, try with 1.1 and let me know if that still happens. Thanks! |
Getting same error. My gradle is compile 'org.bytedeco:javacv:1.1'
compile 'org.bytedeco.javacpp-presets:opencv:3.0.0-1.1:android-x86' // android-arm
compile 'org.bytedeco.javacpp-presets:ffmpeg:2.8.1-1.1:android-x86' // android-arm and error:
I've tried to exclude opencv and ffmpeg modules from javacv dependency, but then getting class not found. I am trying to test it like this: try {
FFmpegFrameRecorder.tryLoad();
} catch (FrameRecorder.Exception e) {
throw new RuntimeException(e);
} Any ideas? |
Looks like a problem with Gradle... What do the Gradle guys say? |
Reorder your packages android{
//Exclude duplicates
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
}
} |
This worked for me with gradle:2.0.0 ... |
Could someone talk with the Gradle developers about what we should be doing with this? |
Have similar issue with SBT:
|
i added those lines as 3dm1 and udayasiri suggested but still the same type of error comes in a different way :( :( duplicate file copied .... |
I am also facing the same issue even after installing manually or directly in Gradle. `Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
|
Just wanted to add that I'm encountering the same issue: `Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
|
The same problem, any idea? :Gradle tasks [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug] Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
|
I don't know what is the solution for this. |
ok problem solved for me . I just followed following steps first i updated my android studio and it is around 200 mb i guess. anyway keep the INTERNET connection on even after the update. and then
4.navigate to Project > Properties > Java Build Path > Libraries and click "Add JARs...". (you can click "app" in your android project view and press f4 and go to dependencies , click plus sign in corner and click file dependencies and proceed) check my updated gradel script. not sure whether this is needed or not.
Now my javacv code is running in android. Thanks who wrote the instructions here. |
Successful solution for Duplicate files exception as below. MUST use the correct duplicateFileException file name 'org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib'. packagingOptions { My exception before solved as below:
|
@saudet my gradle file like this
grade version 2.2.3 is no problem, but then I update grade to 2.3.0,it's not work, show this
I try to exclude 'lib/armeabi/libjniavcodec.so',but it's one by one.too much. |
@eastom Thank you so much 👍 |
@kongqw Same as here
|
Use the following code block
|
Managed to get it build after changing the name from
|
@nicemanis is it work? |
It worked for me |
For those who have error with :
Please refer to this gradle file at link : https://github.com/Karthi96/Video-Recorder-with-Frames-Analysis/blob/master/app/build.gradle Under android
Under dependencies:
|
@jasonakon Ah, so that |
It worked for me. Can you tell me how to use the latest version of JavaCV? |
When I try to build with this implementation compile group: 'org.bytedeco', name: 'javacv-platform', version: '1.5.4' , it was throwing some errors. |
@sieme97 What errors are you getting? |
You're missing the binaries for OpenBLAS here. |
got it, thanks for replying! |
I'm afraid you'll need to figure out why those files are not being copied from the JAR files into the APK file. |
I solved it!
Still got some
in the output, but you mentioned that we can Ignore that in other issue. |
@ianlienfa Please consider updating one of the sample projects like that: https://github.com/bytedeco/sample-projects Thanks! |
Will do! Let me first tidy it up! |
For a working example, I think we can now refer to the JavaCV-android-example sample project that @GZaccaroni has updated: |
Actually I have a project file importing via jar files though its a bit bulky, I can still upload it if needed. |
I think we can finally close this issue. After fixing a few small issues, I've confirmed that the updated JavaCV-android-example sample project works great out of the box with JavaCV 1.5.5, so if anyone is still having issues getting JavaCV running on Android, please start from here: https://github.com/bytedeco/sample-projects/tree/master/JavaCV-android-example |
Furthermore, using Gradle to extract JAR files automatically as per issue #1117 (comment) also prevents unnecessary stuff from getting into the final APK or AAB files. |
After updating to gradle 2.10 I started getting the following error for opencv and ffmpeg:
In order to ignore them, I used
pickFirst
to prevent duplication.Is this the right way to do it or some other approach is advisable?
The text was updated successfully, but these errors were encountered: