wgltony / react-native-braintree-dropin-ui

React Native integration of Braintree Drop-in for IOS & ANDROID (Apple Pay, Google Pay, Paypal, Venmo, Credit Card)
MIT License
78 stars 104 forks source link

Android: Failed to link resources #22

Open adamfellon opened 5 years ago

adamfellon commented 5 years ago

When trying to build on android I get this message.

Android resource linking failed
node_modules/react-native-braintree-dropin-ui/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
node_modules/react-native-braintree-dropin-ui/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
node_modules/react-native-braintree-dropin-ui/android/build/intermediates/res/merged/release/values/values.xml:4320: error: resource android:attr/fontVariationSettings not found.
node_modules/react-native-braintree-dropin-ui/android/build/intermediates/res/merged/release/values/values.xml:4321: error: resource android:attr/ttcIndex not found.
error: failed linking references.

dependencies in build.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 26
        supportLibVersion = "28.0.0"
        // uncomment to get google to work
        googlePlayServicesAuthVersion = "15.0.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.google.gms:google-services:4.0.1' // <--- use this version or newer
kmcmanimen commented 5 years ago

I was able to fix this temporarily by changing the android section in android/build.gradle within the react-native-braintree-dropin-ui project to:

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        warning 'InvalidPackage'
    }
}

It should match the same info in your app's android/build.gradle file.