Anand February 2016

NDK Integration with Android Studio

I'm new in NDK .and try to setup Integration with NDk .But after research through many sites ,i could not solved my problem. Here is build.gradle file

  apply plugin: 'com.android.model.application'
     model {
      android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    }

  android.ndk {
    moduleName "native"
   }

  defaultConfig.with {
    applicationId "app.com.jnitester"
    minSdkVersion.apiLevel 15
    targetSdkVersion.apiLevel 23
    versionCode 1
    versionName "1.0"
    buildConfigFields {
        create() {
            type = "int"
            name = "VALUE"
            value = "1"
        }
    }
}

/*   android.ndk {
    moduleName = "native"
}*/


android.buildTypes {
    release {
        minifyEnabled false
        proguardFiles += file('proguard-rules.txt')
    }
}

android.productFlavors {
    create("flavor1") {
        applicationId "com.app"
    }
}

android.sources {
    main {
        jni {

            source {
                srcDir 'src'
            }
        }
    }
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}

my classpath is:

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

we get error like that:

Error:(18, 0) No signature of method: org.gradle.model.dsl.internal.NonTransformedModelDslBacking.applicationId() is applicable for argument types: (java.lang.String) values: [app.com.jnitester] Open File

when i put buildTypes,productFlavours,sources inside android{} then it gives Errors like that:

Error:(4, 1) A problem occurred configuring project ':app'.
 > Exception thrown while executing model rule: model.android
   > Could not find method compileSdkVersion() for arguments [23] on project ':app'.

may be this questi

Answers


Piotr P February 2016

try adding '=' char. e.g.

compileSdkVersion 23

change to

compileSdkVersion = 23

Post Status

Asked in February 2016
Viewed 2,212 times
Voted 6
Answered 1 times

Search




Leave an answer