Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use with react-native-fcm #467

Closed
awesomejerry opened this issue Aug 15, 2016 · 9 comments
Closed

use with react-native-fcm #467

awesomejerry opened this issue Aug 15, 2016 · 9 comments

Comments

@awesomejerry
Copy link

I was building a new app with react-native-fcm and react-native-maps, but when executing "react-native run-android", the following error occurs.

Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/actions/ItemListIntents;
Unknown source file :   at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
Unknown source file :   at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
Unknown source file :   at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
Unknown source file :   at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Unknown source file :   at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
Unknown source file :   at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
Unknown source file :   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
Unknown source file :   at com.android.dx.command.dexer.Main.run(Main.java:277)
Unknown source file :   at com.android.dx.command.dexer.Main.main(Main.java:245)
Unknown source file :   at com.android.dx.command.Main.main(Main.java:106)

:app:dexDebug FAILED

This is my build.gradle

rootProject.name = 'RNMap'

include ':app'
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/android')
include ':react-native-fcm'
project(':react-native-fcm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fcm/android')

I've tried "./gradlew clean" under android directory, but still not working. Does anyone know how to solve this issue?

@alexHlebnikov
Copy link

Witch version of Google Plays Services do you use? Try latest:

android/build.gradle

dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
        classpath 'com.google.gms:google-services:3.0.0'
    }

android/app/build.gradle

dependencies {
    compile project(':react-native-maps')
    compile fileTree(dir: 'libs', include: ['*.jar'])
    // From node_modules
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.facebook.react:react-native:+'
    compile 'com.google.maps.android:android-maps-utils:0.4.3'
    compile 'com.google.android.gms:play-services-base:9.4.0'
    compile 'com.google.android.gms:play-services-maps:9.4.0'
    compile 'com.google.android.gms:play-services-ads:9.4.0'
    ...
}

@awesomejerry
Copy link
Author

I've changed the version of the Google Plays Service to the latest, but still not working. But thanks!

@JaysonMandani
Copy link

Same issue here.

@JaysonMandani
Copy link

JaysonMandani commented Aug 16, 2016

Actually I fixed this issue don't forget to put gms maps on dependencies.

dependencies { compile 'com.google.android.gms:play-services-maps:9.4.0' }

@jeveloper
Copy link

A bit off topic, this component uses 8.4 google play service.
Just curious, are you guys assuming that all android phones have it more or less updated?
I stumbled upon a couple of phones that had 5.x and 7.x which rendered the map white , no errors or warnings

@JaysonMandani
Copy link

Try to test your app using device or you can check some related issues on the library you used on your maps

@awesomejerry
Copy link
Author

@JaysonMandani It works! Thanks a lot!

@ssomnoremac
Copy link

ssomnoremac commented Oct 24, 2016

@alexHlebnikov I'm getting the dex conflict error on 9.0 but using the same gradle config as you posted I'm getting this error:

Found com.google.android.gms:play-services-maps:9.4.0, but version 9.0.0 is needed for the google-services plugin.

The difference is you don't have fcm in your gradle and that's where the conflict lies.

@ssomnoremac
Copy link

ah, found it. fcm puts imports these dependencies from the node-modules grade file so those have to all match the 9.4.0 or whichever version:
evollu/react-native-fcm#118

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

No branches or pull requests

5 participants