React-native-blur: Not compiling on Android

Created on 6 Dec 2018  路  9Comments  路  Source: Kureev/react-native-blur

I'm getting this errors building the an Android app:

:react-native-blur:verifyReleaseResources/Users/giovanicascaes/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/f18836ec038187733ca84d3a666fc216/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

/Users/giovanicascaes/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/f18836ec038187733ca84d3a666fc216/res/values-v26/values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.

/Users/giovanicascaes/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/f18836ec038187733ca84d3a666fc216/res/values-v26/values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

/Users/giovanicascaes/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/f18836ec038187733ca84d3a666fc216/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.

/Users/giovanicascaes/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/f18836ec038187733ca84d3a666fc216/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/font not found.

/Users/giovanicascaes/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/f18836ec038187733ca84d3a666fc216/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.


error: failed linking references.
:react-native-blur:verifyReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-blur:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

Most helpful comment

This should solve the problem (just add to your android/build.gradle):

buildscript {...}

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
}
...

All 9 comments

Same issue ... :(

I had the same issue, anyone has solution?

Hey, i have upgraded Android version in the build.gradle of the project, and the issue was resolved ...

Maybe a fix will arrive ?

@skymax406 what exactly did you do?

This is my react-native-blur/android/build.gradle file :

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        renderscriptTargetApi 23
        renderscriptSupportModeEnabled true
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    google()
    mavenLocal()
    jcenter()
}

dependencies {
    implementation "com.facebook.react:react-native:+"
}

Maybe check you have android.enableAapt2=false in your android/gradle.properties, it's a workaround, not a fix

I updated the build.gradle of react-native-blur (https://github.com/react-native-community/react-native-blur/blob/master/android/build.gradle#L14), and I put the same SDK and build tool version as mine, which is 28. I don't know what it takes to update the SDK version of this library, does bumping the SDK version of react-native-blur from 25 to 28 break anything? AFAIK it builds and it works on my project using SDK v28.

This should solve the problem (just add to your android/build.gradle):

buildscript {...}

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
}
...

In my case, I had to use it like this

      if(project.hasProperty("android")) {
          android.compileSdkVersion = rootProject.ext.compileSdkVersion
          android.buildToolsVersion = rootProject.ext.buildToolsVersion
       }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tbolt picture tbolt  路  3Comments

schlaegerz picture schlaegerz  路  4Comments

baicuhaha picture baicuhaha  路  4Comments

sandroferrari picture sandroferrari  路  5Comments

acoulon99 picture acoulon99  路  6Comments