Android studio with experimental gradle 0.2.0

后端 未结 3 1543
甜味超标
甜味超标 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:50

    You have to put these blocks outside the android block.

    android.buildTypes
    android.sources
    android.productFlavors
    

    Also the buildConfigFields.with should be inside the defaultConfig or inside the buildTypes or productFlavors:

    Something like:

    model {
        android {
            compileSdkVersion = 22
            buildToolsVersion = "22.0.1"
    
            defaultConfig.with {
                //----
                minSdkVersion.apiLevel = 10
                targetSdkVersion.apiLevel = 23
    
                buildConfigFields.with {
                    create() {
                        //....
                    }
                }
            }
        }
        android.buildTypes {
            release {
                //
            }
        }
        android.productFlavors {
           //
        }
    
        // Configures source set directory.
        android.sources {
            //
        }
    }
    

    Also, the last version is 0.2.1.

    classpath 'com.android.tools.build:gradle-experimental:0.2.1'
    

提交回复
热议问题