Build Failed
FAILURE: Build failed with an exception.
Setting.gradle
rootProject.name = 'Projectname'
include ':react-native-image-crop-picker'
project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android')
include ':react-native-music-control'
project(':react-native-music-control').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-music-control/android')
include ':react-native-sound'
project(':react-native-sound').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sound/android')
include ':react-native-audio-streamer'
project(':react-native-audio-streamer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-audio-streamer/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-orientation'
project(':react-native-orientation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-orientation/android')
include ':react-native-keep-awake'
project(':react-native-keep-awake').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keep-awake/android')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
include ':react-native-photo-view'
project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android')
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/android/app/')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':app'
android/build.gradle
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
maven { url "https://jitpack.io" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
android/app/build.gradle
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
....
targetSdkVersion 27
vectorDrawables.useSupportLibrary = true
.....
}
}
dependencies {
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-navigation')
compile project(':react-native-image-crop-picker')
compile project(':react-native-maps')
compile project(':react-native-vector-icons')
compile project(':react-native-photo-view')
compile project(':react-native-video')
compile project(':react-native-keep-awake')
compile project(':react-native-orientation')
compile project(':react-native-linear-gradient')
compile project(':react-native-audio-streamer')
compile project(':react-native-sound')
compile project(':react-native-music-control')
compile "com.google.android.gms:play-services-base:+"
compile 'com.google.android.gms:play-services-location:+'
compile 'com.google.android.gms:play-services-maps:+'
}
MainApplication.java
import com.facebook.react.ReactPackage;
import com.reactnativenavigation.NavigationApplication;
import com.airbnb.android.react.maps.MapsPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnative.photoview.PhotoViewPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.corbt.keepawake.KCKeepAwakePackage;
import com.github.yamill.orientation.OrientationPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import fm.indiecast.rnaudiostreamer.RNAudioStreamerPackage;
import com.zmxv.RNSound.RNSoundPackage;
import com.tanguyantoine.react.MusicControl;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends NavigationApplication {
@Override
public boolean isDebug() {
// Make sure you are using BuildConfig from your own application
return BuildConfig.DEBUG;
}
protected List<ReactPackage> getPackages() {
// Add additional packages you require here
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
new MapsPackage(),
new VectorIconsPackage(),
new PhotoViewPackage(),
new ReactVideoPackage(),
new KCKeepAwakePackage(),
new OrientationPackage(),
new LinearGradientPackage(),
new RNAudioStreamerPackage(),
new RNSoundPackage(),
new MusicControl(),
new PickerPackage()
);
}
}
I try to clean gradlew and try solution on #641 but no luck.
Edit
Well, I test this packages on New Projects, it's working fine. I enable multiDexEnabled and it's show the problem.. Duplicated dependencies with other packages above. Don't know how to solve it but thanks anyway. You can close this.
try to change your compile project with implementation https://www.youtube.com/watch?v=7ll-rkLCtyk&feature=youtu.be&t=29m18s see this link
Adding implementation("com.android.support:design:27.1.0") to my app level build.gradle solved my problem.
* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven { url "https://jitpack.io" }
google()
}
///try to change build.gradle like this then gradlew clean
and add 2 this code: in app/bulid.gradle
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.android.support:design:27.1.1"
I change to another packages since this one conflict with some of my installed packages and i dont know how to fix this too. Thanks for your helps.
Adding implementation("com.android.support:design:27.1.0") to my app level build.gradle solved my problem.
This fixed the build error for me. Is this just a case of updated dependencies? It seems like everyone affected by this error were updating previous projects using older versions of this lib. Will this dep automatically be pulled in with a fresh install and linking?
Most helpful comment
Adding
implementation("com.android.support:design:27.1.0")to my app level build.gradle solved my problem.