yildirimyigit
yildirimyigit

Reputation: 3022

Experimental NDK Support on Android Studio

I have experience with Android development on Eclipse, but I'm quite new to this gradle stuff.

I created a project on Android Studio and tried adding native library support. I followed the documents on android.com

  1. Android NDK Preview
  2. Experimental Plugin User Guide

I bumped into the following problem and I'm not even familiar with the terminology! It says: Unable to load class 'com.android.build.gradle.managed.ProductFlavor_Impl'

error description

Suggestions did not solve the problem. How can I solve it?

Here are the contents of the build.gradle and app/build.gradle:

build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle-experimental:0.2.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

app/build.gradle

apply plugin: 'com.android.model.application'

model {
    android {
        compileSdkVersion = 23
        buildToolsVersion = "23.0.0"

        defaultConfig.with {
            applicationId = "com.example.wofm"
            minSdkVersion = 15
            targetSdkVersion = 23
            versionCode = 1
            versionName = "1.0"
        }
    }
    android.ndk {
        moduleName = "wofmUtil"
    }

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

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

Upvotes: 1

Views: 868

Answers (1)

Nedko
Nedko

Reputation: 506

You should use minSdkVersion.apiLevel and targetSdkVersion.apiLevel instead of minSdkVersion and targetSdkVersion. And I also had a problem with getDefaultProguardFile() so I had to remove it.

Upvotes: 4

Related Questions