-
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
Error when building an Android Bundle #1117
Comments
It looks like we'd need to create AAR files in addition to JAR files for this to work: |
I have the same issue. |
@talregev Yes, it's possible. Contributions are welcome! |
I'm running into a similar issue: |
BTW, in case anyone is wondering, we can exclude those files from the build. |
I'm a new to Android development. Can you explain how to exclude them from
build.
I'm unable to figure it out.
Thanks!
…On Tue, Nov 12, 2019, 1:04 PM Samuel Audet ***@***.***> wrote:
BTW, in case anyone is wondering, we can exclude those files from the
build.
They are not necessary at runtime.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1117?email_source=notifications&email_token=AJWWA5SPW2TAYU7U5UW2LTTQTJL7RA5CNFSM4GMV5WA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDZJ4XA#issuecomment-552771164>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJWWA5WTUOHRZFFO3HM3KC3QTJL7RANCNFSM4GMV5WAQ>
.
|
@akash2018xD There's some examples of that in issue #353. |
@saudet Excluding file solved the problem, but what does this library do? Don't we need it at all? Thanks |
@lisichka999 No, it should be made more modular, see issue #1071. |
I get a similar error: with javacv included in my kotlin project
But I'm unable to fix it by excluding the files as shown above. I tried the example given above
Which obviously did not work because I use opencv-platform not javacpp-presets. So I adjusted the paths to what I think should be right
But the error persists. Any ideas? |
@phillies You'll need to exclude all the files from |
@saudet How can we exclude all the files from I tried
(my error message was |
Something like this I guess: #1329 (comment) |
Thanks for the super quick response, @saudet! Neither Any other advice? |
Same problem. Did you solved it @marwfair? |
It looks like we need to move those files from |
Thank you for your quick comment Samuel! I succeed💪. I was placing the ffmpeg-android-arm.jar, ffmpeg-android-arm64.jar, ffmpeg-android-x86.jar, and ffmpeg-android-x86_64.jar in the app/libs path instead of placing the image .so files in jniLibs/arm64-v8a and jniLibs/arm64-v7a. Thank you again for your work! 😊 |
Hello @rgm-22 I'm having the same issue:
Could you please provide me with more details to solve the problem? |
Hi @yasserakbbach! Be careful where you are placing this "commons-codec-1.8.jar". You need to follow this file structure:
I hope to help! |
Hi @rgm-22 again,
|
Hi @yasserakbbach! I'm glad you succeed 💪😀. |
Thank you @rgm-22 |
Hii @rgm-22 Please help me how can resolve this problem |
Hi @lakharasachin-qf ! Sorry for the late response. Please, try to follow this structure:
I hope to help! |
Hi @rgm-22! I'm adding the libraries under Adding on build.gradle the following: The APK generation works but when I try to generate a bundle for uploading to the Google Play console I always obtain the same error:
Any idea? |
Hi @hamorillo! In my case, I didn't add the "-android-arm.jar" "-android-arm64.jar" files in app/libs nither build.gradle. Remeber to add the compiled libraries (".so" files) to app/src/main/jniLibs, following the arm64-v8a, armeabi, armeabi-v7a, etc. structure. Please, let me know your results. I hope to help! |
After investigating this thoroughly, it appears that the cleanest solution to this issue is to get Gradle to extract the libraries for us, then tell the plugin for Android to pick them up from that location, and let it do whatever it wants with them. Something like the following in configurations {
javacpp
}
task javacppExtract(type: Copy) {
dependsOn configurations.javacpp
from { configurations.javacpp.collect { zipTree(it) } }
include "lib/**"
into "$buildDir/javacpp/"
android.sourceSets.main.jniLibs.srcDirs += ["$buildDir/javacpp/lib/"]
tasks.getByName('preBuild').dependsOn javacppExtract
}
dependencies {
implementation group: 'org.bytedeco', name: 'javacv', version: '1.5.6'
javacpp group: 'org.bytedeco', name: 'openblas-platform', version: '0.3.17-1.5.6'
javacpp group: 'org.bytedeco', name: 'opencv-platform', version: '4.5.3-1.5.6'
javacpp group: 'org.bytedeco', name: 'ffmpeg-platform', version: '4.4-1.5.6'
...
} To shorten that a bit further, it should be feasible to add this "javacppExtract" task to Gradle JavaCPP, but I'm not sure it's worth the trouble. If that snippet works well enough for everyone here, I may just add that to the docs somewhere. What do you all think? |
I've added that code snippet in commit bytedeco/gradle-javacpp@036a685 and also updated the JavaCV-android-example sample project in commit bytedeco/sample-projects@2378afc, so I think I'll consider this issue solved. If anyone still has any problems with that though, please let me know! |
Hi All, I tried to search ic_launcher.png but my app does not use that name. I don't know how to resolve it. |
Hi all, Error:
Dependecy
I still don't understand how to solve it, thanks. |
Im getting this same error still aswell and I'm unsure if this issue is resolvable still, I've been trying to just manually exclude all the libraries but it takes quite a while |
Please try to follow the instructions here: |
Hey,
Trying to build an Android bundle and not APKs.
I get the following error:
File 'root/lib/arm64-v8a/include/opencv2/core/wimage.hpp' uses reserved file or directory name 'lib'.
I understand it's using a reserved bundle name probably, any idea how can it be fixed or when?
Thanks !
The text was updated successfully, but these errors were encountered: