Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Problem linking tipsi-stripe with rn 0.52.0 #273

Closed
nenti opened this issue Apr 14, 2018 · 5 comments
Closed

Problem linking tipsi-stripe with rn 0.52.0 #273

nenti opened this issue Apr 14, 2018 · 5 comments

Comments

@nenti
Copy link

nenti commented Apr 14, 2018

I keep running into compatibility issues with basic rn 0.52.0 installation

Version tipsi-stripe v5.2.0

Following Compilation Error when adding tipsi to the build:

C:\Users\piust\Documents\nightowl-mobile\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that m

atches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

app/build.gradle

compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        targetSdkVersion 22
       ....

dependencies {
    compile project(':react-native-image-picker')
    compile project(':react-native-fbsdk')
    compile project(':open-gmail')
    compile project(':tipsi-stripe')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    compile 'com.google.android.gms:play-services-base:+'
    compile 'com.google.android.gms:play-services-maps:+'
}

build.gradle

allprojects {
    repositories {
        // Add jitpack repository (added by tipsi-stripe)
        maven { url "https://jitpack.io" }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        configurations.all {
            resolutionStrategy {
                force 'com.facebook.android:facebook-android-sdk:4.22.1'
            }
        }
    }
}

I tried upgrading build tools and other solutions from earlier tickets but ended up failing to fix it. Please help resolving this issue.

@isnifer
Copy link
Contributor

isnifer commented Apr 14, 2018

@nenti
Copy link
Author

nenti commented Apr 14, 2018

@isnifer Thx for pointing that out to me. Upgrading to 26 sdk version results in crashing the app on launch. Tried that already.

04-14 18:30:19.982 4898-4898/com.nightowlmobile E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.nightowlmobile, PID: 4898
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
        at android.app.ActivityThread.installProvider(ActivityThread.java:6335)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5927)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5866)
        at android.app.ActivityThread.-wrap3(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6692)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/com.nightowlmobile-1/base.apk"],nativeLibraryDirectories=[/data/app/com.nightowlmobile-1/lib/arm, /data/app/com.nightowlmobile-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:6335) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5927) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5866) 
        at android.app.ActivityThread.-wrap3(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:154) 
        at android.app.ActivityThread.main(ActivityThread.java:6692) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358) 

@nenti
Copy link
Author

nenti commented Apr 14, 2018

I got the solution. As far as I understand I have different libraries that use different com.google.android.gms versions, so after upgrading to SDK version 26 the app crashed through overfitting the namespace with 2 libraries.

Resolution was found here: react-native-maps/react-native-maps#1777 (comment)

I solved it by adding resolutionStrategy to android/build.gradle

configurations.all {
    resolutionStrategy {
        force 'com.facebook.android:facebook-android-sdk:4.22.1'
    }
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.getRequested().getGroup() == 'com.google.android.gms') {
            details.useVersion('11.8.0')
        }
    }
}

@nenti nenti closed this as completed Apr 14, 2018
@beausmith
Copy link

beausmith commented Aug 2, 2018

One note on using the resolutionStrategy suggested above…

I was configuring react-native-push-notifications and it needed a version of a file in the group com.google.android.gms which was more recent than 11.8.0 so I had to remove the resolutionStrategy code.

I ran react-native run-android and awaited something with tipsi-stripe to fail… but I must have done something between then and now which made this resolutionStrategy no longer necessary. Unfortunately, I'm not sure which bit of code it was. 😐

@mark-slepkov
Copy link

I have solved this #273 (comment) error by adding next strings into my ./android/build.gradle

ext {
    ...
    firebaseVersion = "16.0.1"
    googlePlayServicesVersion = "15.0.1"
    ...
}

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

No branches or pull requests

4 participants