Android studio with experimental gradle 0.2.0

后端 未结 3 1545
甜味超标
甜味超标 2021-01-19 13:30

I am trying to setup a basic ndk build with the latest version of android studio at this moment. Trying to follow this tutorial

This is my gradle-w

3条回答
  •  终归单人心
    2021-01-19 13:47

    @jonagon Some examples are in this repo:
    https://github.com/googlesamples/android-ndk

    probably could try:

    • Use the latest plugin version. Find it at:https://jcenter.bintray.com/com/android/tools/build/gradle-experimental
    • check https://github.com/googlesamples/android-ndk/blob/master/hello-jni/app/build.gradle for product flavors

    jni folder issue:

    1. it is default for gradle experimental plugin, also for older c++ support NOT using gradle-experimental plugin ( android plugin )

    2. if you have that folder and not using experimental plugin, Gradle thinks that app is using the older android studio c++ support. It gives your that warning "NDK integration is deprecated in the current plugin" and recommend you to experimental plugin. it could be silenced with:

      • sourceSets.main.jni.srcDirs = []

    or just rename that jni folder to something else: it will cause more trouble if you want to android-studio cmake/ndk-build in the future, rename is better.

提交回复
热议问题