1

I am using stack blur library for my app it works fine for api 16 but when I tried to run the app in api 21 the app is getting crashed. I tried to fix the library gradle but it is giving me error message while compiling. This is the library that I am using

Error enter image description here My App gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
    applicationId "com.example.neelay.level34"
    minSdkVersion 16
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"

    multiDexEnabled true
    testInstrumentationRunner   "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
repositories {
maven { url 'http://Manabu-GT.github.com/GlassView/mvn-repo' }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.ms.square:glassview:0.1.0'
compile 'com.romainpiel.shimmer:library:1.4.0@aar'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.android.support:support-v4:24.2.1'
testCompile 'junit:junit:4.12'
compile project(':StackBlur')
}

And Stack blur gradle

apply plugin: 'com.android.library'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
}

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
    renderscriptTargetApi 21
    renderscriptSupportModeEnabled true
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    // Move the tests to tests/java, tests/res, etc...
    instrumentTest.setRoot('tests')

    // Move the build types to build-types/<type>
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
    // This moves them out of them default location under src/<type>/... which would
    // conflict with src/ being used by the main source set.
    // Adding new build types or product flavors should be accompanied
    // by a similar customization.
    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
}
}

 task nativeLibsToJar(type: Zip, description: 'create a jar archive of the native libs') {
destinationDir file("$buildDir/native-libs")
baseName 'native-libs'
extension 'jar'
from fileTree(dir: 'libs', include: '**/*.so')
from fileTree(dir: 'renderscript', include: '**/*.so')
into 'lib/'
}

tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}

I chanded my stack blur gradle

 compileSdkVersion 19
buildToolsVersion '21.1.2'

defaultConfig {
    renderscriptTargetApi 19
    renderscriptSupportModeEnabled true
}

these are the lines that I changed.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Neelay Srivastava
  • 1,041
  • 3
  • 15
  • 46

0 Answers0