- Notifications
You must be signed in to change notification settings - Fork830
Support for Android 10#361
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
sidhuparas commentedJul 9, 2020
Hi@1nikolas, Thanks you for coming out with an approach to fix it. I came across this issue today and saw your PR. I felt that this would work and this should've worked. But I am getting following error when I try this with Android 10:
I tried it on an Emulator running Android 10. After researching, it seems that FFMpeg and Google both have refused to fix this Text relocations issue. I just forked the library from your repo and imported it. Then gave a try. Am I doing something wrong? Also, before it used to work on Android < 10. But now it's throwing the error in those versions as well:
Looking forward to your response. |
1nikolas commentedJul 9, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The emulator uses by default x86 architecture and it doesnt work on x86 on Android 6+ that way (as I already mentioned). As for the other error, you have to add these on your app build.gradle (so it forces arm64 devices to use the arm binary and x86_64 to use the x86 one)
|
Ronnys commentedJul 10, 2020
how can we use the new commit?? |
You can find the fork on my account or you can click |
sidhuparas commentedJul 10, 2020
@1nikolas Thanks for the quick reply. I tried your suggestion and it worked for Android < 10. But when I tested it on Android 10, it gave me a long error (couldn't see full error). I know that to resolve the issue, I should provide that error but there came some fault in the device and I am fixing it. As soon as it goes up, I will post the trace here. Thank you for the time. |
Ahmed-Basalib10 commentedJul 14, 2020
@1nikolas what did u mean by ffmpeg binary ? |
1nikolas commentedJul 14, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Pre build ffmpeg executables for each cpu architecture. This libary uses those to run ffmpeg (on the current commit its on theassets folder and on my commit its on thelibs folder) |
SundaramKrishna commentedJul 16, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
this fix will be released ? or i have to pull from@1nikolas repository |
I don't think so. This repo is abandoned since 2016.. |
arjun-6573 commentedJul 19, 2020
Its working fine but unable to upload app on play store |
1nikolas commentedJul 19, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Okay this is a problem I didn't predict. A workaround for this would be to keep the abifilters as you mentioned and copy libffmpeg.so from libs/x86 to libs/x86_64 and libffmpeg.so from libs/arm to libs/arm64. But this will make the apk size larger as it would have the library 4 times inside the apk. Anyway to everyone reading this, this PR is a workaround and doesnt work 100% because this library is super old. Just use a newer ffmpeg library (which uses ndk) instead of trying to fix this one. Its not worth the time. |
sidhuparas commentedJul 20, 2020
@1nikolas Can you recommend a "newer ffmpeg library"? For some strange reason, I still can't get hold of my Android 10 phone. I will be looking to implement your fix otherwise I might go for a newer library. |
There are many libs butthis seems to be the most popular. You can google "ffmpeg android github" to find more . |
sidhuparas commentedJul 26, 2020
@1nikolas Well, thank you. I migrated to that library's LTS support (for which min SDK is 21) and it's working perfectly on Android 10. Thank you! 🎉 |
HungTDO commentedJul 27, 2020
When I'm applied your code into my project, then I run project always recieved error: "ava.io.IOException: Cannot run program "/data/app/com.abc.xxx-eFkeAFz_FIOZAFRtph32mw==/lib/arm/libffmpeg.so": error=2, No such file or directory"? |
Herz3h commentedJul 27, 2020
@HungTDO check this#361 (comment) |
HungTDO commentedJul 28, 2020
It's worked! Thanks so much! |
Ahmed-Basalib10 commentedJul 31, 2020
Can you explain how did you do that ? |
sidhuparas commentedJul 31, 2020
@Ahmed715 Just go to thisrepo. Find the gradle dependency to add. Just remember you need to use |
khacdat1994 commentedAug 8, 2020
How to switch between android Q version and below? Thank. I'm read file from libs folder but not working |
My fix should work in all android versions. Whats the error? |
godhiepnt commentedAug 24, 2020
Hi,@1nikolas Can you show me what the folders look like after copying? It's unable to load binary. It's always failing |
@godhiepnt they way you did it, it should work. Whats the error? The file isn't copied in the app data libs? |
godhiepnt commentedAug 24, 2020
Yes. If in buildTypes , abiFilters "armeabi-v7a", "x86" it works great . But abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' error : Can you help me understand better? |
@godhiepnt try using these two abi filters only |
godhiepnt commentedAug 25, 2020
This release is not compliant with the Google Play 64-bit requirement. @1nikolas Can you help me fix it? |
1nikolas commentedAug 25, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@godhiepnt you have to copy contents of arm to arm64 and cotents of x86 to x86_64. And then you have to modify some code (on FileUtils.java line 59 you have to add 2 more else ifs according on how arch folders are named) |
krushnarathod commentedAug 27, 2020
solution work in debug mode , but when we generate sign apk ,through as error#360 java.io.IOException: Cannot run program "/data/app/com.test.maker--dN1llxm8vYjyFIC4I3iHA==/lib//libffmpeg.so": error=2, No such file or directory |
If you use |
krushnarathod commentedAug 28, 2020
is there any solution for arm64-v8a x86_64 because when we fetch ffmpeg from lib folder it wont detect .so file, Through file not exist error. |
did you add those?
|
krushnarathod commentedAug 28, 2020
Yes added it work fine with that. but using this it exclude arm64-v8a x86_64 , so there is no 64 bit arch. according to new google play policy apps published on Google Play will need to support 64-bit architectures |
Okay then remove these I mentioned and copy x86 files in the x86_64 folder and arm files to arm64 folder (I dont remember the exact folder names) |
krushnarathod commentedAug 28, 2020
I did .but show the same issue |
@krushnarathod are you sure you used the correct folder names? |
krushnarathod commentedAug 28, 2020
Yes ,folder name is correct |
@krushnarathod try mobile-ffmpeg lts version. I don't know how to fix your problem |
krushnarathod commentedAug 29, 2020
// return context.getPackageResourcePath().replaceAll("/([^/]+)$", "/lib/") + archFolder + "/" + ffmpegFileName; Changed in FileUtils.java class and it works |
Udhayarajan commentedMar 30, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for modifying this. By the way , How to add your commit in build,gradle like implementation 'com.github.1nikolas:ffmpeg-android-java:master-SNAPSHOT' is this correct? Another question will it works on Android 11 and Upcoming android 12? |
dmkenza commentedMar 30, 2021
@Udhayarajan Use this Library is very big, but you can generate that you need. And use apk split also.
|
@Udhayarajan you have to go to my profile, download my fork and import it manually to your project. But I haven't tested it with android 11 and 12. If you are going to upload your app on Playstore, just usemobile-ffmpeg with split apks. |
Udhayarajan commentedMar 30, 2021
It works on Android 11 |
pintudhameliya123 commentedApr 2, 2021
Hi,@1nikolas I still get below error while compiling this library.. java.io.IOException: Cannot run program "/data/app/com.test.maker--dN1llxm8vYjyFIC4I3iHA==/lib//libffmpeg.so": error=2, No such file or directory |
What Android are you on? It's only tested on Android 10. Also did you add |
pintudhameliya123 commentedApr 2, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Already add android:extractNativeLibs = "true" in the manifest |
Udhayarajan commentedApr 2, 2021
@pintudhameliya123 try disabling offline gradle build and rebuild project. Also try https://github.com/tanersener/mobile-ffmpeg It is working on Android 11 also tested |
NoVaTin202 commentedApr 10, 2021
I got this error when writing ffmpeg from assets to lib on android 10. Is anyone showing me the solution. |
Ahmed-Basalib10 commentedJul 29, 2021
Yes it is working but what about the size of ur app , mine is so large after i used this lib |
Udhayarajan commentedJul 29, 2021
Yes mine too. 30MB to 75MB which is huge. Try to split apks based on abis or use AAB if use Google play store to publish |
Ahmed-Basalib10 commentedJul 29, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Also it supports only android level 24 and above , is there any way to make it support lower versions also from 21 level |
Udhayarajan commentedJul 29, 2021
@Ahmed-Basalib10 use LTS version btw,FFMPEG is archived useFFmpegKit instead. |
csandhack commentedApr 23, 2024
I need to add this library natively , how do I do that, can you please tell me the steps to add it in my application natively and run on android 11. |
Uh oh!
There was an error while loading.Please reload this page.
Based onthis post.
Moved ffmpeg binary to the libs folder and added
android:extractNativeLibs = "true"
to the manifest so it can copy itself into/data/app/{package_name}/lib/{arch}/
and then execute it from there (which is supported on Android 10).The x86 binary doesn't work on Android 6+, and that's a separate bug (seehere andhere)
Fixes#343
Fixes#355
Fixes#360