-
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
Gradle Android presets only for old Arm & x86? #754
Comments
The same binaries work just fine for new devices as well.
|
so I can put .so files from "android-arm" to 'armeabi-v7a', 'arm64-v8a' folders (jniLibs) and from "android-x86" to 'x86_64'? |
no, it won't work if I just copy .so files from arm to arm64 So it only works if I set to use only 32 bit libraries in my app:
but I don't want to solve the problem like this because I have other libraries (not just javacv) and I prefer to use 64 bit compiled .so files, only this javacv library in my project lacks those files |
Yes of course it's possible. If you have any issues creating 64-bit binaries, let me know and I will help! Also, please consider making a contribution with those binaries once you create them. Thank you In any case, making this as a duplicate of bytedeco/javacpp-presets#52 |
FYI, build instructions are in the README.md file: |
Firstly I tried to build ffmpeg libs just for arm (not arm64)
(8 files) but it seems there should be more .so files like from http://central.maven.org/maven2/org/bytedeco/javacpp-presets/ffmpeg/3.2.1-1.3/ffmpeg-3.2.1-1.3.jar:
(17 files) Also tried to compile arm64 In
to (changed lines for arm)
but when I run I get an error:
So I have two problems:
|
You need to run `mvn install` to get all files.
|
Is this write a command? I tried it but build failed:
|
Also I want to build only for ffmpeg, not opencv or something else |
Just build JavaCPP as well, and use the `mvn --projects` option. It's all documented on the links I gave you.
|
I did all of this: in my
get back to
|
I run
|
Could you show me the error that you get? |
Just post the whole log, thanks! |
how to do it? commands with
|
Just copy/paste from the console maybe? |
but it doesn't show full log (from the start), and quite hard to copy all of it, |
So here my stuff I run
I got (but it doesn't show some logs from the start) |
Looks like x264 wants to use yasm here. Could you try to install it or add that flag to the cppbuild.sh script? |
yes, that's normal |
so again I got only 8 files (which != 0 bytes): in original libraries (for arm v7) there are 16 .so files: (http://central.maven.org/maven2/org/bytedeco/javacpp-presets/ffmpeg/3.2.1-1.3/ffmpeg-3.2.1-1.3.jar) so it won't work with only those 8 files (ffmpeg video recording in android, app will crash with some Unsatisfied Link Error) |
The files you're looking for are in the "target" subdirectory.
|
Your changes don't look right, no. Check the NDK's documentation.
|
Please help to generate arm v8 (64 bit) for android . |
I stopped for a while this process. |
We need to build for the arm64 architecture, that's all. Someone needs to
spend time to read documentation and try stuff.
|
Where is the source code for linjniopencv_core.so and libjniopencv_imagproc.so ? So that we can rebuild it. |
They are generated at build time and deleted upon success. Set the "deleteJniFiles" plugin configuration option or the "javacpp.deleteJniFiles" system property to "false" to keep them around for debugging purposes. |
Seems I almost succeeded in building arm64-v8a for FFMPEG 3.2.1: @saudet could you please take a look? Script (.sh) - automatically downloads ffmpeg library code:
I got 7 .so files (not 8) I don't know if we need this one (in my case do I need it for ffmpeg recording - FFmpegFrameRecorder?) But at the end of my build I got some errors (though it built all 7 .so files):
What could be wrong and why did it still build all .so files? And also, what about other 8 .so files? For arm-v7 as @saudet said we can find it in the target folder of javacpp - #754 (comment) (javacpp-presets/ffmpeg/target/classes/org/bytedeco/javacpp/linux-x86_64/) but will they suit for arm64-v8a or do we also need to build those .so files differently (also for 64 bit architecture) ? Or they fit/suit for any architecture? (arm32 or arm64, or x86 or x86_64) even if I got them during building for arm-v7a (32 bit)? I tried to add my 7 .so files (which I have built using that script, removed numbers in filename for each .so files of cousre) and other .so files from "javacpp-presets/ffmpeg/target/classes/org/bytedeco/javacpp/linux-x86_64" folder to \app\src\main\jniLibs\arm64-v8a in "javacpp-presets/ffmpeg/target/classes/org/bytedeco/javacpp/linux-x86_64" there were 15 files (also it had libpostproc.so), I copied those files to my "...\jniLibs\arm64-v8a" without replace (because some files from 7 .so arm64-v8a building already there) at end I got next picture: but when I run my app (start recording video using FFmpegFrameRecorder) I get runtime error:
yeah, building log also mentioned avutil (as I said above) - "cannot find libavutil/libavutil.a: No such file or directory":
Full Log when building for arm64-v8a: |
To get the same set of files and features, reuse as much of the commands from the cppbuild.sh file for android-arm, but change the flags required for android-arm64. |
I edited javacpp-presets/cppbuild.sh like this
here is everything normal for arm64-v8a? but as I understood I also have to edit cppbuild.sh in ffmpeg folder - javacpp-presets/ffmpeg/cppbuild.sh find everything related to arm-v7a and replace with what arm64-v8a needs? |
is there any logging so I could read which errors (in flags) happened?
it's hard to debug script when I don't know where error happens (javacpp-presets/ffmpeg/cppbuild.sh)
|
You found some flags that appear to work in your comment above (#754 (comment)), so start by trying those out! |
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror). about this error,the cause was that you didn't actually have the appropriate GNU C compilers installed or GCC path is not properly。 you can do this sudo apt-get install build-essential |
@luzengqi and? did you do everything it suggested to do? |
@anonym24 I met this mistake before and now solved it。I recently began to compile, in the process of compiling encountered a lot of the same problem with you。arm64 I have not compiled out, |
@saudet Which is the directory for the output of the so file? |
Which so file? In any case, just pick it from the final JAR file.
|
@saudet i mean is that i use your build tools to build armv7 and arm64 v8 so file ,when i completed built,What is the output directory? i want to use these on my android project. |
The output directory is where you set your local repo, which is usually
~/.m2
|
@saudet sorry, i can't find this ~/.m2 directory. |
No, learn more about Maven: http://maven.apache.org/ |
@luzengqi Before they are packaged in artifacts, they are all found under the |
64-bit builds for Android (as the "android-arm64" and "android-x86_64" platforms) are now available, so please give it a try! Binaries for 1.4.1-SNAPSHOT can be downloaded from the snapshot repository: http://bytedeco.org/builds/ |
What about presets for 'x86_64', 'armeabi-v7a', 'arm64-v8a'? So after compilation only armeabi & x86 folders have .so files (in app.apk/lib)
I don't even want to support old armeabi (it should be at least armeabi-v7a)
Do I have to compile libraries by myself? No predefined libraries for all modern architectures?
How to do it?
The text was updated successfully, but these errors were encountered: