React-native-keychain: Release build failed for task ':react-native-keychain:verifyReleaseResources'

Created on 28 Sep 2018  路  2Comments  路  Source: oblador/react-native-keychain

Hi,

After I upgraded to react-native 0.57, I have a build error when I do ./gradlew assembleRelease on macOS.

error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/Users/fff/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/c97eeec7497a526c566e57640211f0a5/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

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

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

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

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

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

error: failed linking references.

FAILURE: Build failed with an exception.

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




    buildToolsVersion = "27.0.3"
    minSdkVersion = 16
    compileSdkVersion = 27
    targetSdkVersion = 26
    supportLibVersion = "27.1.1"
dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.google.gms:google-services:4.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

Most helpful comment

oh, just fixed it by some hint from this thread: https://github.com/facebook/react-native/issues/19239#issuecomment-393898039

in android/build.gradle, add this:

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

            defaultConfig {
                targetSdkVersion 27
            }
        }
    }
}

All 2 comments

oh, just fixed it by some hint from this thread: https://github.com/facebook/react-native/issues/19239#issuecomment-393898039

in android/build.gradle, add this:

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

            defaultConfig {
                targetSdkVersion 27
            }
        }
    }
}

@vonovak Could you verify the issue is a valid one? Could you also advise that my solution is the correct solution?

Was this page helpful?
0 / 5 - 0 ratings