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.
@nenti Hi! Check dependencies and repositories sections for these files https://github.com/tipsi/tipsi-stripe/blob/master/example/android/app/build.gradle
https://github.com/tipsi/tipsi-stripe/blob/master/example/android/build.gradle
@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)
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: https://github.com/react-community/react-native-maps/issues/1777#issuecomment-344138434
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')
}
}
}
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. 😐
I have solved this https://github.com/tipsi/tipsi-stripe/issues/273#issuecomment-381341494 error by adding next strings into my ./android/build.gradle
ext {
...
firebaseVersion = "16.0.1"
googlePlayServicesVersion = "15.0.1"
...
}
Most helpful comment
I got the solution. As far as I understand I have different libraries that use different
com.google.android.gmsversions, so after upgrading to SDK version 26 the app crashed through overfitting the namespace with 2 libraries.Resolution was found here: https://github.com/react-community/react-native-maps/issues/1777#issuecomment-344138434
I solved it by adding resolutionStrategy to android/build.gradle