Skip to content

Unable to use Clang as part of Android Studio #28

Closed

Description

@swisspol

With the previous NDK bundle from Android Studio, you could tell Gradle to use Clang toolchain to compile the JNI library as in:

 android.ndk {
        platformVersion = "18"  // Must be in-sync with minSdkVersion.apiLevel
        moduleName = "jni"
        toolchain "clang"
        toolchainVersion "3.6"
        ...
}

With the new NDK bundle 11.0.0, this doesn't work anymore, with or without toolchainVersion and even if using llvm instead of clang for toolchain.

Gradle sync failed: Cause: org.gradle.api.internal.ExtensibleDynamicObject Consult IDE log for more details (Help | Show Log)

Activity

  1. DanAlbert commented on Mar 18, 2016

    @DanAlbert
    Contributor
  2. thielsn commented on Mar 18, 2016

    @thielsn

    I have the same issue. Also, with the updated Android NDK, Revision 11b.
    Gradle plugin: com.android.tools.build:gradle-experimental:0.4.0

  3. vharron commented on Mar 21, 2016

    @vharron

    I think you're going to need to upgrade to the latest experimental plugin.

    Studio 2.0: com.android.tools.build:gradle-experimental:0.6.0-beta7
    Studio 2.1: com.android.tools.build:gradle-experimental:0.7.0-alpha3

  4. swisspol commented on Mar 21, 2016

    @swisspol
    Author

    I have Android Studio 1.5.1, the latest official release with gradle-experimental:0.4.0, the latest non-alpha, beta or whatever version I'm aware of.

    How do you know what's the latest experimental gradle available? The official page only lists 0.4.0 and 0.6.0-alpha3: http://tools.android.com/tech-docs/new-build-system/gradle-experimental. This whole thing is such a mess 😞

  5. vharron commented on Mar 21, 2016

    @vharron

    I walked over to the gradle lead and asked him. :) It is a mess. Sorry, we're working on it.

  6. swisspol commented on Mar 21, 2016

    @swisspol
    Author

    Please start by spending 10 minutes updating http://tools.android.com/tech-docs/new-build-system/gradle-experimental. The list of versions in "Gradle Requirements", "DSL Change" and "Change Log" are completely out of sync. Just fixing this so there's one source of reliable truth will help a number of people. Thanks!

    In the meantime, what's the latest stable version of that plugin I can use with Android Studio 1.5.1?

  7. gnolnuhc commented on Mar 24, 2016

    @gnolnuhc

    I am trying to use Clang to compile under Android Studio and got the same error.
    I am not expecting ndk support under AS to be complete. But I am very curious about the agenda for NDK under AS. When will it become official under stable release of Android Studio?

  8. DanAlbert commented on Mar 24, 2016

    @DanAlbert
    Contributor

    @swisspol: sounds like there currently isn't a stable version of the gradle plugin that supports r11

    @gnolnuhc: I'm told the stable release is due in a few weeks

  9. DanAlbert commented on Mar 30, 2016

    @DanAlbert
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions