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
Build process failed - :app:dexDebug FAILED #378
Comments
i have same problem :( |
not sure why but if you go into android and do a ./gradlew clean it solves the issue |
can you comment your app/build.gradle file? so i can help you . Is your simulator or physical device connected while building app? |
yep. i solved by: cd android/ && ./gradlew clean && cd .. && react-native run-android |
Not working for me, same error... :/ |
I try to reproduce my work. Maybe something will help you identify, what am I doing wrong. (not just me like I see). I build on real device Samsung J5 Android 5.1.1. react-native init test2
cd test2
react-native run-android
adb reverse tcp:8081 tcp:8081
react-native start Everything works well, but this is clean RN0.29. Then npm install --save react-native-maps
sudo rnpm link react-native-maps Then I add Google Maps key to AndroidManifest.xml. Point 4 in installation instructions. Then react-native run-android First false: $ react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Cannot evaluate module react-native-maps : Configuration with name 'default' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED This false was fixed like I wrote in first comment with add /lib at the end in projectDir in android/settings.gradle. Then :app:dexDebug
Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Landroid/support/v7/appcompat/R$anim;
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
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 2
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED I fixed this with texas697 idea, so thumbs up for him. $ ./gradlew clean
:app:clean
:react-native-maps:clean
BUILD SUCCESSFUL
Total time: 1.47 secs Then react-native run-android
adb reverse tcp:8081 tcp:8081
react-native start Build process success, but shows blank view and false in console. /**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions
} from 'react-native';
import MapView from 'react-native-maps/components/MapView';
let { width, height } = Dimensions.get('window');
const ASPECT_RATIO = width / height;
const LATITUDE = 37.78825;
const LONGITUDE = -122.4324;
const LATITUDE_DELTA = 0.0922;
const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO;
class test2 extends Component {
render() {
return (
<View style={styles.container}>
<MapView
ref="map"
style={styles.map}
initialRegion={{
latitude: LATITUDE,
longitude: LONGITUDE,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA
}}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
justifyContent: 'flex-start',
alignItems: 'center'
},
map: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0
}
});
AppRegistry.registerComponent('test2', () => test2); I think somebody wrote about this issue, but not for Android, but IOS. I did not test it on IOS. Thanks for help. |
My last console error in previous comment was fixed by https://github.com/lelandrichardson/react-native-maps/issues/375 Thank you very much everybody. |
well what i did to get past this was |
texas's solution works for me |
texas's thanks works fine |
Yes, this worked for me too. cd android cd .. Any idea why this is? |
./gradlew clean not worked for me 😞 but, |
|
Yes, Its working cd android/ && ./gradlew clean && cd .. && react-native run-android |
Resolved my problem too. Thanks for the help. |
try this on build.gradle compile (project(':react-native-maps')) {
exclude group: "com.google.android.gms"
} |
all above donot work for me. I solved this when i noticed that i used "com.google.android.gms:play-services-*******" at several places(airbnb use it like :play-services-maps***** ) and they have multipile version. I changed the version to the same one and my app build worked |
I recently made a fresh example build. |
I guess the solution is to unlink react-native-maps ( react-native unlink react-native-maps) |
I'm new to react native, Where should I add this..? |
I'm using react-native-maps and my issue was
|
open your app in android studio .. let it sychronize gradle and update |
I init new react-native project and I wanted to include react-native-maps, but it shows me this error.
I had to add
/lib
at the end in projectDir inandroid/settings.gradle
I do not know, what am I doing wrong. I am sure, that problem is in somewhere in react-native-maps module, because it was the last, what I installed from npm and then I wanted to build and it shows me error.
Dependencies:
Thanks for help.
The text was updated successfully, but these errors were encountered: