Android 2.2 preview 4 and NDK builds: NDK r12b fails with externalNativeBuild "Option gcc-toolchain requires an argument"

119 views
Skip to first unread message

Streets Of Boston

unread,
Jul 6, 2016, 10:01:44 AM7/6/16
to android-ndk
Using Android 2.2 preview 4, NDK version r12b, Gradle wrapper version 2.14, Gradle plugin version 2.2.0-alpha4:

When syncing Android Studio with the build.gradle, the sync fails with this exception in the generateJsonModel task.

Caused by: joptsimple.OptionMissingRequiredArgumentException: Option gcc-toolchain requires an argument
at joptsimple.RequiredArgumentOptionSpec.detectOptionArgument(RequiredArgumentOptionSpec.java:48)
at joptsimple.ArgumentAcceptingOptionSpec.handleOption(ArgumentAcceptingOptionSpec.java:254)
at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:459)
at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:59)
at joptsimple.OptionParser.parse(OptionParser.java:381)
at com.android.build.gradle.external.gnumake.CommandClassifier$NativeCompilerBuildTool.createCommand(CommandClassifier.java:206)
at com.android.build.gradle.external.gnumake.CommandClassifier.classify(CommandClassifier.java:56)
at com.android.build.gradle.external.gnumake.FlowAnalyzer.analyze(FlowAnalyzer.java:46)
at com.android.build.gradle.external.gnumake.NativeBuildConfigValueBuilder.addCommands(NativeBuildConfigValueBuilder.java:98)
at com.android.build.gradle.tasks.NdkBuildExternalNativeJsonGenerator.processBuildOutput(NdkBuildExternalNativeJsonGenerator.java:74)
at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.buildAndPropagateException(ExternalNativeJsonGenerator.java:246)
at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.build(ExternalNativeJsonGenerator.java:167)
...
...


When switching back to NDK version r11c, all works fine.

Dan Albert

unread,
Jul 6, 2016, 3:51:00 PM7/6/16
to android-ndk, Raymond Chiu
Are you one Windows by any chance? Are you using Clang or GCC?

+chiur, this looks like the response file line ending problem with GCC to me, but I thought there was a workaround in gradle for that.


--
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.
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/84d1c0e7-16d9-48ab-8291-75b40c861a1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raymond Chiu

unread,
Jul 6, 2016, 4:01:21 PM7/6/16
to Dan Albert, android-ndk, Jomo Fisher, Chaoren Lin
This is using the external native build instead of the experimental pluign.  It calls ndk-build directly.  Can ndk-build create response file?

Streets Of Boston

unread,
Jul 6, 2016, 4:32:59 PM7/6/16
to android-ndk, ch...@google.com
Hi Dan,

I'm on a Mac running El Capitan and I'm using Clang.
Reply all
Reply to author
Forward
0 new messages