Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:react-native-autogrow-textinput:verifyReleaseResources FAILED AAPT: error: resource android:attr/colorError not found. #51

Open
zedtux opened this issue Oct 2, 2018 · 3 comments

Comments

@zedtux
Copy link

zedtux commented Oct 2, 2018

With React-Native 0.57 and react-native-autogrow-textinput 5.1.1, I'm trying to build a beta version, during the build I have the following error :

:app:assembleRelease
:react-native-autogrow-textinput:extractReleaseAnnotations UP-TO-DATE
:react-native-autogrow-textinput:mergeReleaseConsumerProguardFiles UP-TO-DATE
:react-native-autogrow-textinput:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:react-native-autogrow-textinput:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:react-native-autogrow-textinput:transformNativeLibsWithSyncJniLibsForRelease UP-TO-DATE
:react-native-autogrow-textinput:bundleRelease UP-TO-DATE
:react-native-autogrow-textinput:compileReleaseSources UP-TO-DATE
:react-native-autogrow-textinput:mergeReleaseResources UP-TO-DATE
:react-native-autogrow-textinput:verifyReleaseResources/Users/zedtux/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/f1cd761f58c96deaa16acc3d5f07445e/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

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

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

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

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

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

error: failed linking references.
:react-native-autogrow-textinput:verifyReleaseResources FAILED

FAILURE: Build failed with an exception.

Here is the my android/build.gradle file :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        google()
    }
}

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "27.1.1"
            }
        }
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}
@fishg
Copy link

fishg commented Oct 21, 2018

me too

@ghost
Copy link

ghost commented Oct 26, 2018

Hey I've found the solution. You have to update the appcompat-v7 support library from the react-native-autogrow-textinput package to 26.0.0 and the compileSdkVersion as well as the buildToolsVersion to something like ~ 27

The file where you have to commit these changes is this one: node_modules/react-native-autogrow-textinput/android/build.gradle

You can see the changes in this pull request

@zedtux
Copy link
Author

zedtux commented Oct 31, 2018

Thank you @MarcAndre-Wessner for your comment.

Meanwhile your PR is merged, I'm using the following in my android/build.gradle file :

buildscript {
    ext {
        googlePlayServicesVersion = "11.6.0"
        firebaseVersion = "11.6.0"

        // Picking your compileSdkVersion, minSdkVersion, and targetSdkVersion :
        // https://medium.com/androiddevelopers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 26
        supportLibVersion = "28.0.0"
    }
    // ...
}
// ...
// Dirty fix for react-native-autogrow-textinput
// See https://github.com/wix/react-native-autogrow-textinput/pull/52
subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants