react-native-blur icon indicating copy to clipboard operation
react-native-blur copied to clipboard

Not compiling on Android

Open giovanicascaes opened this issue 6 years ago • 9 comments

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

giovanicascaes avatar Dec 05 '18 23:12 giovanicascaes

Same issue ... :(

Sebastien-Lampazona avatar Dec 07 '18 14:12 Sebastien-Lampazona

I had the same issue, anyone has solution?

d2luu avatar Dec 10 '18 04:12 d2luu

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

Maybe a fix will arrive ?

Sebastien-Lampazona avatar Dec 10 '18 07:12 Sebastien-Lampazona

@skymax406 what exactly did you do?

giovanicascaes avatar Dec 10 '18 11:12 giovanicascaes

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:+"
}

Sebastien-Lampazona avatar Dec 10 '18 12:12 Sebastien-Lampazona

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

Sebastien-Lampazona avatar Dec 10 '18 12:12 Sebastien-Lampazona

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.

Slals avatar Jan 09 '19 03:01 Slals

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
            }
        }
    }
}
...

engineering-addict avatar Jan 29 '19 22:01 engineering-addict

In my case, I had to use it like this

      if(project.hasProperty("android")) {
          android.compileSdkVersion = rootProject.ext.compileSdkVersion
          android.buildToolsVersion = rootProject.ext.buildToolsVersion
       }

akshaygore06 avatar May 21 '19 00:05 akshaygore06