Fazecast / jSerialComm

Platform-independent serial port access for Java
GNU Lesser General Public License v3.0
1.34k stars 287 forks source link

Error when trying to build for Android #278

Closed civilordergone closed 4 years ago

civilordergone commented 4 years ago

I have navigated to the new android make location (instructions on the main page were slightly outdated): /src/main/c/Posix/jni

And ran $NDK_HOME/ndk-build

It throws this error:

/Users/timnuwin1/Downloads/jSerialComm-master/src/main/c/Posix/jni/Android.mk:14: warning: ignoring old recipe for target 'all'
[arm64-v8a] Compile        : jSerialComm <= SerialPort_Posix.c
[arm64-v8a] Compile        : jSerialComm <= PosixHelperFunctions.c
[arm64-v8a] SharedLibrary  : libjSerialComm.so
[arm64-v8a] Install        : libjSerialComm.so => libs/arm64-v8a/libjSerialComm.so
[x86_64] Compile        : jSerialComm <= SerialPort_Posix.c
[x86_64] Compile        : jSerialComm <= PosixHelperFunctions.c
[x86_64] SharedLibrary  : libjSerialComm.so
[x86_64] Install        : libjSerialComm.so => libs/x86_64/libjSerialComm.so
[armeabi-v7a] Compile thumb  : jSerialComm <= SerialPort_Posix.c
[armeabi-v7a] Compile thumb  : jSerialComm <= PosixHelperFunctions.c
[armeabi-v7a] SharedLibrary  : libjSerialComm.so
[armeabi-v7a] Install        : libjSerialComm.so => libs/armeabi-v7a/libjSerialComm.so
[x86] Compile        : jSerialComm <= SerialPort_Posix.c
[x86] Compile        : jSerialComm <= PosixHelperFunctions.c
[x86] SharedLibrary  : libjSerialComm.so
[x86] Install        : libjSerialComm.so => libs/x86/libjSerialComm.so
rmdir /Q /S libs obj
rmdir: /Q: No such file or directory
rmdir: /S: No such file or directory
rmdir: libs: No such file or directory
rmdir: obj: No such file or directory
make: *** [/Users/timnuwin1/Downloads/jSerialComm-master/src/main/c/Posix/jni/Android.mk:14: all] Error 1
civilordergone commented 4 years ago

Now I'm getting this error.

/jSerialComm/src/main/c/Posix$ $NDK_HOME/ndk-build
jni/Android.mk:14: warning: overriding recipe for target 'all'
jni/Android.mk:14: warning: ignoring old recipe for target 'all'
jni/Android.mk:14: warning: overriding recipe for target 'all'
jni/Android.mk:14: warning: ignoring old recipe for target 'all'
jni/Android.mk:14: warning: overriding recipe for target 'all'
jni/Android.mk:14: warning: ignoring old recipe for target 'all'
[arm64-v8a] Compile        : jSerialComm <= SerialPort_Posix.c
[arm64-v8a] Compile        : jSerialComm <= PosixHelperFunctions.c
[arm64-v8a] SharedLibrary  : libjSerialComm.so
[arm64-v8a] Install        : libjSerialComm.so => libs/arm64-v8a/libjSerialComm.so
[x86_64] Compile        : jSerialComm <= SerialPort_Posix.c
[x86_64] Compile        : jSerialComm <= PosixHelperFunctions.c
[x86_64] SharedLibrary  : libjSerialComm.so
[x86_64] Install        : libjSerialComm.so => libs/x86_64/libjSerialComm.so
[armeabi-v7a] Compile thumb  : jSerialComm <= SerialPort_Posix.c
[armeabi-v7a] Compile thumb  : jSerialComm <= PosixHelperFunctions.c
[armeabi-v7a] SharedLibrary  : libjSerialComm.so
[armeabi-v7a] Install        : libjSerialComm.so => libs/armeabi-v7a/libjSerialComm.so
[x86] Compile        : jSerialComm <= SerialPort_Posix.c
[x86] Compile        : jSerialComm <= PosixHelperFunctions.c
[x86] SharedLibrary  : libjSerialComm.so
[x86] Install        : libjSerialComm.so => libs/x86/libjSerialComm.so
rmdir /Q /S libs obj
rmdir: /Q: No such file or directory
rmdir: /S: No such file or directory
rmdir: libs: Directory not empty
rmdir: obj: Directory not empty
make: *** [jni/Android.mk:14: all] Error 1
hedgecrw commented 4 years ago

Hi there, sorry about that...the Makefile was updated to work with the Windows SDK instead of the Linux one...let me see if I can make it auto-detect which OS it's being called on. For the time being, open the src/main/c/Posix/jni/Android.mk file and delete the 'all: rmdir /Q /S libs obj' lines, and it should build just fine!

hedgecrw commented 4 years ago

Alright, if you pull the latest code from the GitHub source, it should build correctly regardless of Windows/Linux. Please report back and close if this works for you. Thanks!

civilordergone commented 4 years ago

Great, thank you!!