diux-dev / rosettadrone

Android-based mavlink wrapper for DJI drones
BSD 3-Clause "New" or "Revised" License
113 stars 51 forks source link

build issues #22

Closed Codierama closed 5 years ago

Codierama commented 5 years ago

Hello,

I tried to build the source code from the release 1.2.0 by my own, but had no success. I tried on Windows and Linux development environment. Used following components:

Linux:

Android Studio 3.2.1 OpenJDK 64 version 9 Gradle version 4.6 Android Plugin Version 3.2.1 SDK version API 27 Build Tools Version 28.0.3

Windows:

only difference is Oracle JDK version 8 Update 191

Error is:

Build command failed. Error while executing process /home/is/Android/Sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /mnt/Transfer/rosettadrone-1.2.0/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target djivideojni} [1/1] Linking C shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libdjivideojni.so FAILED: : && /home/is/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=armv7-none-linux-androideabi27 --gcc-toolchain=/home/is/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/is/Android/Sdk/ndk-bundle/sysroot -fPIC -isystem /home/is/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -mfpu=neon -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /home/is/Android/Sdk/ndk-bundle/platforms/android-27/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a -L/home/is/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libdjivideojni.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libdjivideojni.so CMakeFiles/djivideojni.dir/src/main/cpp/dji_video_jni.c.o ../../../../src/main/cpp/lib/armeabi-v7a/libffmpeg.so /home/is/Android/Sdk/ndk-bundle/platforms/android-27/arch-arm/usr/lib/liblog.so -latomic -lm && : /home/is/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ../../../../src/main/cpp/lib/armeabi-v7a/libffmpeg.so:1:9: syntax error, unexpected STRING /home/is/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ../../../../src/main/cpp/lib/armeabi-v7a/libffmpeg.so: not an object or archive /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:42: error: undefined reference to 'av_register_all' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:44: error: undefined reference to 'av_codec_next' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:76: error: undefined reference to 'avcodec_register_all' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:77: error: undefined reference to 'av_register_all' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:80: error: undefined reference to 'avcodec_find_decoder' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:81: error: undefined reference to 'avcodec_alloc_context3' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:82: error: undefined reference to 'av_parser_init' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:94: error: undefined reference to 'avcodec_open2' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:99: error: undefined reference to 'av_frame_alloc' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:120: error: undefined reference to 'av_init_packet' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:129: error: undefined reference to 'av_parser_parse2' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:162: error: undefined reference to 'av_free_packet' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:214: error: undefined reference to 'avcodec_close' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:218: error: undefined reference to 'av_free' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:219: error: undefined reference to 'av_free' /mnt/Transfer/rosettadrone-1.2.0/app/src/main/cpp/dji_video_jni.c:220: error: undefined reference to 'av_parser_close' clang: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

Could you please give more Information in the Readme about the required tools and versions to successful build the apk.

Thanks Codierama

sdowhy commented 5 years ago

Try the newest commits to the repository and let me know if you have any issues.

Codierama commented 5 years ago

Hello,

new commits working well!

Thank you very much.