Uh oh!
There was an error while loading. Please reload this page.
Support for Android 10 - #361
Conversation
sidhuparas
commented
Jul 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. |
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
commented
Jul 10, 2020
how can we use the new commit?? |
1nikolas
commented
Jul 10, 2020
You can find the fork on my account or you can click |
sidhuparas
commented
Jul 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
commented
Jul 14, 2020
@1nikolas what did u mean by ffmpeg binary ? |
Pre build ffmpeg executables for each cpu architecture. This libary uses those to run ffmpeg (on the current commit its on the assets folder and on my commit its on the libs folder) |
this fix will be released ? or i have to pull from @1nikolas repository |
1nikolas
commented
Jul 16, 2020
I don't think so. This repo is abandoned since 2016.. |
arjun-6573
commented
Jul 19, 2020
Its working fine but unable to upload app on play store |
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
commented
Jul 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. |
1nikolas
commented
Jul 20, 2020
There are many libs but this seems to be the most popular. You can google "ffmpeg android github" to find more . |
sidhuparas
commented
Jul 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
commented
Jul 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
commented
Jul 27, 2020
@HungTDO check this #361 (comment) |
HungTDO
commented
Jul 28, 2020
It's worked! Thanks so much! |
Ahmed-Basalib10
commented
Jul 31, 2020
Can you explain how did you do that ? |
sidhuparas
commented
Jul 31, 2020
@Ahmed715 Just go to this repo. Find the gradle dependency to add. Just remember you need to use |
khacdat1994
commented
Aug 8, 2020
How to switch between android Q version and below? Thank. I'm read file from libs folder but not working |
1nikolas
commented
Aug 10, 2020
My fix should work in all android versions. Whats the error? |
godhiepnt
commented
Aug 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 |
1nikolas
commented
Aug 24, 2020
@godhiepnt they way you did it, it should work. Whats the error? The file isn't copied in the app data libs? |
godhiepnt
commented
Aug 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? |
1nikolas
commented
Aug 24, 2020
@godhiepnt try using these two abi filters only |
godhiepnt
commented
Aug 25, 2020
This release is not compliant with the Google Play 64-bit requirement. @1nikolas Can you help me fix it? |
@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
commented
Aug 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 |
1nikolas
commented
Aug 27, 2020
If you use |
krushnarathod
commented
Aug 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. |
1nikolas
commented
Aug 28, 2020
did you add those? |
krushnarathod
commented
Aug 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 |
1nikolas
commented
Aug 28, 2020
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
commented
Aug 28, 2020
I did .but show the same issue |
1nikolas
commented
Aug 28, 2020
@krushnarathod are you sure you used the correct folder names? |
krushnarathod
commented
Aug 28, 2020
Yes ,folder name is correct |
1nikolas
commented
Aug 28, 2020
@krushnarathod try mobile-ffmpeg lts version. I don't know how to fix your problem |
krushnarathod
commented
Aug 29, 2020
// return context.getPackageResourcePath().replaceAll("/([^/]+)$", "/lib/") + archFolder + "/" + ffmpegFileName; Changed in FileUtils.java class and it works |
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
commented
Mar 30, 2021
@Udhayarajan Use this Library is very big, but you can generate that you need. And use apk split also. |
1nikolas
commented
Mar 30, 2021
@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 use mobile-ffmpeg with split apks. |
Udhayarajan
commented
Mar 30, 2021
It works on Android 11 |
pintudhameliya123
commented
Apr 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 |
1nikolas
commented
Apr 2, 2021
What Android are you on? It's only tested on Android 10. Also did you add |
Already add android:extractNativeLibs = "true" in the manifest |
Udhayarajan
commented
Apr 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
commented
Apr 10, 2021
I got this error when writing ffmpeg from assets to lib on android 10. Is anyone showing me the solution. |
Ahmed-Basalib10
commented
Jul 29, 2021
Yes it is working but what about the size of ur app , mine is so large after i used this lib |
Udhayarajan
commented
Jul 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 |
Also it supports only android level 24 and above , is there any way to make it support lower versions also from 21 level |
Udhayarajan
commented
Jul 29, 2021
@Ahmed-Basalib10 use LTS version btw, FFMPEG is archived use FFmpegKit instead. |
csandhack
commented
Apr 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. |


Based on this 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 (see here and here)
Fixes#343
Fixes#355
Fixes#360