kraffslol / react-native-braintree-xplat

Cross-platform Braintree module for React Native
MIT License
81 stars 121 forks source link

AAPT: No resource identifier found for attribute 'appComponentFactory' in package 'android' #108

Closed zasyadev closed 5 years ago

zasyadev commented 5 years ago

I am facing a issue with react-native-braintree-xplat . I am getting the following error when trying to build the app.

\?\E:\projects\deets-mobile-cp\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:88: AAPT: No resource identifier found for attribute 'appComponentFactory' in package 'android'

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:processReleaseResources'. Failed to process resources, see aapt output above for details.

I guess react-native-braintree-xplat is package is causing it because when I remove this package, the app builds successfully. So is there any work around I can use to resolve this error or i'll have to implement the javascript SDK provided by Braintree.

"react": "16.2.0" "react-native": "0.53.3" "react-native-braintree-xplat": "^4.0.0"

arundas1903 commented 5 years ago

I am facing the same issue. react-native-braintree-xplat:processDebugResources

Please let me know if you find the issue again

mlazari commented 5 years ago

I have a similar issue after the update of Braintree SDK to 2.18.1: screen shot 2018-11-08 at 1 05 37 pm If I change the version to 2.18.0 in this file - https://github.com/kraffslol/react-native-braintree-xplat/blob/master/android/build.gradle#L24 - then it builds fine. Does anyone know what can be the cause of that error with 2.18.1?

L.E. I just found a similar issue in Braintree SDK project: https://github.com/braintree/braintree_android/issues/238

quinnjn commented 5 years ago

I don't have experience with React Native but the compileSdkVersion and buildToolsVersion on this project is quite behind.

Since Google Play has added target API restrictions, I'd recommend updating these values soon.

zasyadev commented 5 years ago

I found the solution to this problem. Braintree has recently updated the library to support Android 28, and the issue comes from there. You should force com.braintreepayments.apito version 2.17.0

I do it in my project build.gradle with

allprojects {
    repositories {
        ......
        configurations.all {
            resolutionStrategy {
                force 'com.braintreepayments.api:braintree:2.18.0'
            }
        }
        ......
    }
quinnjn commented 5 years ago

@zasyadev that is not the correct answer, it's just a band aid and you're preventing folks from using the latest versions by being stuck on 2.18.0.

The compileSdkVersion for this library needs to be bumped to the latest version and that should solve it. Bumping compileSdkVersion would not be a breaking change.

Ian Lake has an excellent article on picking Android SDK Versions.