Updated NDK in Android Studio to NDK 13 Beta 2, all STL STD header files are now gone

387 views
Skip to first unread message

Chuck Moyes

unread,
Sep 13, 2016, 8:25:44 PM9/13/16
to android-ndk
Just updated my NDK in Android Studio to the new update, now all of my STD/STL header files are gone. Any ideas what happened?



I'm using:
stl = "c++_static"

Thanks,
Charles
Auto Generated Inline Image 1

Dan Albert

unread,
Sep 13, 2016, 8:37:28 PM9/13/16
to android-ndk
Are they not found at compile time, or are they just not playing nice with syntax highlighting or something?

What version of Studio are you using? The support for NDK r13 was added to a recent version of the gradle plugin, so if you don't have that it won't work yet.

Артем Мостяев

unread,
Sep 14, 2016, 11:56:04 AM9/14/16
to android-ndk
I'm getting the same after the latest update.

Android Studio 2.1.3
Sdk Tools 25.2.2

Gradle plugin 2.1.3
Gradle expermental 0.7.3

The following errors appears when compiling:

fatal error: string: No such file or directory
 #include <string>
                  ^
compilation terminated.

fatal error: iostream: No such file or directory
 #include <iostream>
                    ^
compilation terminated.

exception: No such file or directory
 #include <exception>
                     ^
compilation terminated.

and so on.. <random>, <algorithm>, <iterator>

If I change c++_static to stlport_static, the problem goes away, but I need exactly c++_static for random.

P.S. Checked with NDK 12 on colleague's desktop and c++_static works fine.

среда, 14 сентября 2016 г., 3:37:28 UTC+3 пользователь Dan Albert написал:

Dan Albert

unread,
Sep 14, 2016, 1:35:19 PM9/14/16
to android-ndk
Somehow the beta NDK ended up in the stable channel. AS 2.1 doesn't have support for NDK r13, so that's what went wrong here (probably for both of you, but the OP didn't include his AS version so idk).

Chuck Moyes

unread,
Sep 14, 2016, 11:31:07 PM9/14/16
to android-ndk
Ugh, is there any way to downgrade? Are you guys going to push another update to the stable channel to get everyone back?

Muhammad Arafat

unread,
Oct 12, 2016, 12:35:37 PM10/12/16
to android-ndk
I have AS 2.2 and using the stable gradle with the new externalNativeBuild support for ndkbuild.

I am seeing the same issue, but the project is building fine. When I hover the cursor over the include statement, the inspector says in the pop over: "Connot find vector". 

Maybe it is an issue with the inspector. I am using APP_STL := c++_static

Chuck Moyes

unread,
Oct 12, 2016, 4:45:32 PM10/12/16
to android-ndk
Yes, Muhammad, today it appears to have broken again.

I suspect that another beta update was accidentally released into stable. That release team really needs to figure out what's going on.

It's okay if it happens once, but twice? Come on...

Chuck

Chuck Moyes

unread,
Oct 12, 2016, 4:46:06 PM10/12/16
to android-ndk
Issue started happening again with AS 2.2.1 and today's NDK update. Please fix ASAP -- I can't push my app's update.


On Tuesday, September 13, 2016 at 5:25:44 PM UTC-7, Chuck Moyes wrote:

Muhammad Arafat

unread,
Oct 12, 2016, 4:46:06 PM10/12/16
to android-ndk
Not seeing this issue anymore after updating to AS 2.2.1

Chuck Moyes

unread,
Oct 22, 2016, 7:07:05 PM10/22/16
to android-ndk
Hmm, I'm on 2.2.2 with r13 and c++_static, still having the problem.


On Tuesday, September 13, 2016 at 5:25:44 PM UTC-7, Chuck Moyes wrote:

Muhammad Arafat

unread,
Oct 26, 2016, 1:31:35 PM10/26/16
to android-ndk
Chuck, 

I recently started fresh on a new project to wrap all my native code in an android lib, and I ran into the problem. Make sure that APP_STL:=c++_static is defined in your Application.mk makefile and also that build.gradle references the path of the Application.mk file.

defaultConfig {
  ...

   externalNativeBuild {
     ndkBuild {
        targets "<your_native_module_name>"
        arguments "NDK_APPLICATION_MK=<path_to_Application.mk>"
     }
  }
}

externalNativeBuild
{
   ndkBuild
{
      path
"<path_to_Android.mk>"  // gradle assumes that Application.mk is located in the same dir. But if you are using submodules, this is not the case.
  }
}

I am currently on AS 2.2.2 and ndk 13.1.3345770

Hope this was helpful.

Charles Moyes

unread,
Oct 26, 2016, 4:43:52 PM10/26/16
to andro...@googlegroups.com
Is it required now to use the NDK build or cmake system? Right now, I'm still using gradle-experimental.

Migrating to a new build system at Google's whim is a LOT of work for us, we have higher priorities, such as adding new features that actually help our users.

It's quite the ask to just force everyone to switch build systems all of a sudden like that (and include this rather drastic change as part the normal update process in the Android Studio UI).

Chuck

--
You received this message because you are subscribed to a topic in the Google Groups "android-ndk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-ndk/tQEDqKkAa34/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/aadaf1d2-2c38-466f-9d0b-9803b234d2c1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Charles Moyes
CTO & Founder
Lingoland

Chuck Moyes

unread,
Oct 26, 2016, 4:58:06 PM10/26/16
to android-ndk
Thanks for your help, Muhammad, you let me know everything I needed. Everything you see here is just feedback for Google.

To be clear, I actually do much prefer the NDK build system over gradle, but I don't think it was the right decision to abruptly pull the plug on gradle for everybody like this. We're pretty deeply entrenched with gradle right now (given that we started developing our 100 kLOC project well over 10 months ago, back when the only option WAS gradle).

Chuck

Kwadwo Busumtwi

unread,
Oct 27, 2016, 11:03:53 AM10/27/16
to android-ndk
Thanks so much Muhammad. Do you think you could post a sample project on github?

At present I am having issues with the new build.

I have followed documentation to the letter but can't seem to get my shared libraries to work.

Muhammad Arafat

unread,
Oct 28, 2016, 7:20:25 PM10/28/16
to android-ndk
Kwadwo,

Here is a link to the example I just uploaded: https://github.com/marafat/debuggable-ndk-example

The example I uploaded is for linking the ndk module to a submodule in your Android project, while still be able to debug and use STL headers. It uses the new ndk support through the stable gradle build tools. For tutorial on how to link ndk module to the main app module check out: https://goo.gl/ML4iaz

Hope this is helpful !!

Kwadwo Busumtwi

unread,
Oct 31, 2016, 11:50:06 AM10/31/16
to android-ndk

I really appreciate it Muhammad. Thank you
Reply all
Reply to author
Forward
0 new messages