Failed to build the sample app with C++ support

76 views
Skip to first unread message

Zwei

unread,
Feb 15, 2017, 10:11:45 AM2/15/17
to android-ndk
Hi,all

I followed https://developer.android.com/studio/projects/add-native-code.html to create a new android studio project with C++ support, but when I tried to build and run this project, android studio complained
this compile error:
















However I didn't modify any build files or setting, and when I created this project, I chose the Toolchain Default option and without
Exceptions Support nor Runtime Type Information Support.

Here are some information of my machine and tools:

Operating System: Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
Android Studio:
Android Studio 2.2.3
Build #AI-145.3537739, built on December 2, 2016
JRE: 1.8.0_76-release-b03 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

SDK tools:



I would be grateful for any help.

Pisey Hang

unread,
Mar 5, 2017, 12:44:36 PM3/5/17
to android-ndk
เมื่อ วันพุธที่ 15 กุมภาพันธ์ ค.ศ. 2017 22 นาฬิกา 11 นาที 45 วินาที UTC+7, Zwei เขียนว่า:
> Hi,all
>
> I followed https://developer.android.com/studio/projects/add-native-code.html to create a new android studio project with C++ support, but when I tried to build and run this project, android studio complained
> this compile error:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> However I didn't modify any build files or setting, and when I created this project, I chose the Toolchain
> Default option and without
> Exceptions Support nor Runtime Type Information Support.
>
> Here are some information of my machine and tools:
>
> Operating System: Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
> Android Studio:
> Android Studio 2.2.3
> Build #AI-145.3537739, built on December 2, 2016
> JRE: 1.8.0_76-release-b03 amd64
> JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
>
> SDK tools:
>
>
>
>
>

Gerry Fan

unread,
Mar 24, 2017, 4:19:05 PM3/24/17
to android-ndk
Not totally sure still the case for the 2.3.  Tested OS are at the download page, scroll all way to the bottom:

Ubuntu is the one I could try and worked for me.

Alex Cohn

unread,
Mar 30, 2017, 4:46:00 AM3/30/17
to android-ndk
Somehow you run the host compiler, not the NDK compiler. You can find the CMake logs in app/.externalNativeBuild folder.

BR,
Alex Cohn
Reply all
Reply to author
Forward
0 new messages