Re: Problem with ndk-build

2,633 views
Skip to first unread message

David Turner

unread,
Dec 31, 2012, 11:18:54 AM12/31/12
to andro...@googlegroups.com
It is just a warning, not an error. It tells you that your manifest targets API level 8 (Android 2.2, a.k.a. Froyo), but your native code targets API level 14 (Android 4.0, a.k.a. Ice Cream Sandwich). This means your application will appear as compatible with any Froyo / Gingerbread / Honeycomb device on the Play Store, but the machine code will likely fail to run (either fail to load, or crash at runtime) on these devices.

Unless you have specific version checks in your Java code to prevent running the problematic native code on these devices, this will be a bad thing. Hence the warning. At the moment, I don't think ndk-build looks at the value of maxSdkVersion, the warning could probably be omitted if its value is high enough.

On Tue, Dec 18, 2012 at 9:46 PM, JohnV <jgv...@gmail.com> wrote:
I'm running under Windows 7, Eclipse w/ Andriod ADT, NDK and Cygwin.  When I try to build my native code using the ndk-build command, I get this message: "/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml"

Any/all help will be greatly appreciated!
Thanks,
John

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/yoA2tQbb51cJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Alex Cohn

unread,
Jan 28, 2013, 4:48:19 AM1/28/13
to andro...@googlegroups.com
Bjorn, your observation is correct. There are 3 ways to resolve the problem and let Eclipse (sorry, ADT) to build the project.
  1. disable the CDT GNU C/C++ error parser (in the second tab in Project properties/C Build/Settings).
  2. use ndk-build APP_MIN_PLATFORM_LEVEL=99 <any other parameters as usual>
  3. edit file $NDK/build/core/add_application.mk: in line 128 change __ndk_warning to __ndk_info
IMHO, the first approach is bad because it breaks "jump to error" in Eclipse. The third approach is good except you modify an NDK file. The second approach has its drawback, too: the warning will not appear at all.

The warning is important, because if you use higher platform features in your native code, the app may crash. I disagree with Digit, though: there are many ways to conditionally execute the code that relies on a higher platform, and the checks may be performed not only in Java, but in native code, too.

BR,
Alex

On Friday, January 11, 2013 11:23:55 PM UTC+2, Bjorn Gott wrote:
When I attempt to compile my test project with native code, I get the same message but as an error, not just a warning.  It will not allow me to compile my project for Gingerbread and later.  I am using the ADT 21.0.1 plugin on a Mac with the latest version of eclipse and ndk-r8d.  By cutting out gingerbread, it is cutting out about half the existing install base.

Thanks,
Bjorn

Alex Cohn

unread,
Mar 14, 2013, 9:41:59 AM3/14/13
to andro...@googlegroups.com
See discussion at https://code.google.com/p/android/issues/detail?id=39752

Another workaround for this warning is to add line to Application.mk:

override APP_MIN_PLATFORM_LEVEL=99

Gerard Meier

unread,
Mar 15, 2013, 5:59:17 AM3/15/13
to andro...@googlegroups.com
For me, adding "APP_PLATFORM := android-9" to jni/Application.mk did the trick. Platform 9 is our target.

Gerard

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.

To post to this group, send email to andro...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages