Skip to content
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

Latest version of native-libandroidthings makes the build fail #4

Open
leinardi opened this issue Apr 7, 2018 · 2 comments
Open

Latest version of native-libandroidthings makes the build fail #4

leinardi opened this issue Apr 7, 2018 · 2 comments

Comments

@leinardi
Copy link

leinardi commented Apr 7, 2018

The latest version of native-libandroidthings (6900125a40e7ce4f76f094b67ba78a2defdb7709) is breaking the build of this project:

$ ./gradlew build

> Task :blink:generateJsonModelDebug
-- Check for working C compiler: /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
-- Check for working C compiler: /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
-- Check for working CXX compiler: /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found AndroidThings: /home/leinardi/Workspace/androidThings/sample-nativepio/libandroidthings/armeabi-v7a/lib/libandroidthings.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/leinardi/Workspace/androidThings/sample-nativepio/blink/.externalNativeBuild/cmake/debug/armeabi-v7a
-- Check for working C compiler: /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
-- Check for working C compiler: /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
-- Check for working CXX compiler: /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found AndroidThings: /home/leinardi/Workspace/androidThings/sample-nativepio/libandroidthings/x86/lib/libandroidthings.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/leinardi/Workspace/androidThings/sample-nativepio/blink/.externalNativeBuild/cmake/debug/x86

> Task :blink:externalNativeBuildDebug
Build blink x86
[1/6] Building C object CMakeFiles/native-app-glue.dir/home/leinardi/android-sdk/ndk-bundle/sources/android/native_app_glue/android_native_app_glue.c.o
[2/6] Building CXX object CMakeFiles/android-system-properties.dir/home/leinardi/Workspace/androidThings/sample-nativepio/android-system-properties/AndroidSystemProperties.cpp.o
[3/6] Linking C static library libnative-app-glue.a
[4/6] Linking CXX static library libandroid-system-properties.a
[5/6] Building CXX object CMakeFiles/blink.dir/blink.cpp.o
[6/6] Linking CXX shared library /home/leinardi/Workspace/androidThings/sample-nativepio/blink/build/intermediates/cmake/debug/obj/x86/libblink.so
FAILED: : && /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++  --target=i686-none-linux-android --gcc-toolchain=/home/leinardi/android-sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 --sysroot=/home/leinardi/android-sdk/ndk-bundle/sysroot -fPIC -isystem /home/leinardi/android-sdk/ndk-bundle/sysroot/usr/include/i686-linux-android -D__ANDROID_API__=26 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11  -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /home/leinardi/android-sdk/ndk-bundle/platforms/android-26/arch-x86 -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -L/home/leinardi/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86 -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now  -u ANativeActivity_onCreate -shared -Wl,-soname,libblink.so -o /home/leinardi/Workspace/androidThings/sample-nativepio/blink/build/intermediates/cmake/debug/obj/x86/libblink.so CMakeFiles/blink.dir/blink.cpp.o  -landroid -llog libnative-app-glue.a /home/leinardi/Workspace/androidThings/sample-nativepio/libandroidthings/x86/lib/libandroidthings.so libandroid-system-properties.a -latomic -lm "/home/leinardi/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86/libc++_static.a" "/home/leinardi/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86/libc++abi.a" && :
/home/leinardi/android-sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: /home/leinardi/Workspace/androidThings/sample-nativepio/libandroidthings/x86/lib/libandroidthings.so: incompatible target
/home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:51: error: undefined reference to 'APeripheralManagerClient_new'
/home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/m
ain/cpp/blink.cpp:54: error: undefined reference to 'APeripheralManagerClient_openGpio'
/home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:56: error: undefined reference to 'AGpio_setDirection'
/home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:61: error: undefined reference to 'AGpio_getValue'
/home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:65: error: undefined reference to 'AGpio_setValue'
/home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:82: error: undefined reference to 'AGpio_delete'
/home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:83: error: undefined reference to 'APeripheralManagerClient_delete'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':blink:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /media/Dati_ext4/android-sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /home/leinardi/Workspace/androidThings/sample-nativepio/blink/.externalNativeBuild/cmake/debug/x86 --target blink}
  [1/6] Building C object CMakeFiles/native-app-glue.dir/home/leinardi/android-sdk/ndk-bundle/sources/android/native_app_glue/android_native_app_glue.c.o
  [2/6] Building CXX object CMakeFiles/android-system-properties.dir/home/leinardi/Workspace/androidThings/sample-nativepio/android-system-properties/AndroidSystemProperties.cpp.o
  [3/6] Linking C static library libnative-app-glue.a
  [4/6] Linking CXX static library libandroid-system-properties.a
  [5/6] Building CXX object CMakeFiles/blink.dir/blink.cpp.o
  [6/6] Linking CXX shared library /home/leinardi/Workspace/androidThings/sample-nativepio/blink/build/intermediates/cmake/debug/obj/x86/libblink.so
  FAILED: : && /home/leinardi/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++  --target=i686-none-linux-android --gcc-toolchain=/home/leinardi/android-sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 --sysroot=/home/leinardi/android-sdk/ndk-bundle/sysroot -fPIC -isystem /home/leinardi/android-sdk/ndk-bundle/sysroot/usr/include/i686-linux-android -D__ANDROID_API__=26 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11  -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /home/leinardi/android-sdk/ndk-bundle/platforms/android-26/arch-x86 -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -L/home/leinardi/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86 -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now  -u ANativeActivity_onCreate -shared -Wl,-soname,libblink.so -o /home/leinardi/Workspace/androidThings/sample-nativepio/blink/build/intermediates/cmake/debug/obj/x86/libblink.so CMakeFiles/blink.dir/blink.cpp.o  -landroid -llog libnative-app-glue.a /home/leinardi/Workspace/androidThings/sample-nativepio/libandroidthings/x86/lib/libandroidthings.so libandroid-system-properties.a -latomic -lm "/home/leinardi/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86/libc++_static.a" "/home/leinardi/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86/libc++abi.a" && :
  /home/leinardi/android-sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: /home/leinardi/Workspace/androidThings/sample-nativepio/libandroidthings/x86/lib/libandroidthings.so: incompatible target
  /home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:51: error: undefined reference to 'APeripheralManagerClient_new'
  /home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:54: error: undefined reference to 'APeripheralManagerClient_openGpio'
  /home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:56: error: undefined reference to 'AGpio_setDirection'
  /home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:61: error: undefined reference to 'AGpio_getValue'
  /home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:65: error: undefined reference to 'AGpio_setValue'
  /home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:82: error: undefined reference to 'AGpio_delete'
  /home/leinardi/Workspace/androidThings/sample-nativepio/blink/src/main/cpp/blink.cpp:83: error: undefined reference to 'APeripheralManagerClient_delete'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org
@proppy
Copy link
Contributor

proppy commented Apr 10, 2018

Thanks for the report, I think this may comes from the x86 target, can you try to remove it from abiFilters in https://github.com/androidthings/sample-nativepio/blob/master/blink/build.gradle#L30

@leinardi
Copy link
Author

Can confirm that removing the target x86 solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants