cesardeazevedo / react-native-bottom-sheet-behavior

react-native wrapper for android BottomSheetBehavior
MIT License
1.16k stars 114 forks source link

Execution failed for task `:app:transformClassesWithMultidexlistForDebug` #45

Closed aryalprakash closed 5 years ago

aryalprakash commented 6 years ago

I am getting error after adding this package. `FAILURE: Build failed with an exception.

My android.defaultConfig has multiDexEnabled true. And dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath 'com.google.gms:google-services:4.0.1'

cesardeazevedo commented 6 years ago

Hi, have you tried to run the example project? Also, can you post your build.gradle?

aryalprakash commented 6 years ago

My build.gradle `// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { ext { buildToolsVersion = "27.0.3" minSdkVersion = 16 compileSdkVersion = 27 targetSdkVersion = 26 supportLibVersion = "27.1.1" } repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath 'com.google.gms:google-services:4.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

allprojects { repositories { google() mavenLocal() maven { url "https://maven.google.com" } 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" } jcenter() } }

task wrapper(type: Wrapper) { gradleVersion = '4.4' distributionUrl = distributionUrl.replace("bin", "all") } `

ntgussoni commented 5 years ago

Im having the same issue, the example app works perfectly.

Im using react-native-firebase-starter with a fresh install, maybe this is a reproduceable way for you. Im sorry I cannot provide more information, this is my very first mobile app

ntgussoni commented 5 years ago

This is part of the stacktrace.

com.android.build.api.transform.TransformException: Error while generating the main dex list.
> Error while generating the main dex list.
  > com.android.tools.r8.errors.CompilationError: Program type already present: android.support.design.widget.CoordinatorLayout$DefaultBehavior
    > Program type already present: android.support.design.widget.CoordinatorLayout$DefaultBehavior
okb1100 commented 5 years ago

@ntgussoni and anyone who's having the same error; I had the same error and I got my project to compile by adding implementation 'com.android.support:design:27.1.0' inside app/build.gradle dependencies.

dineshmm23 commented 5 years ago

Problem is with com.android.support:design not trageting to latest.. i hope this can be fixed currently by

adding this line to ./android/build.gradle(module) not app

//Ensure that all dependencies use the same version of the Android Support library

subprojects {
    subproject ->
    afterEvaluate{
        if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
   project.configurations.all {
       resolutionStrategy.eachDependency { details ->
           if (details.requested.group == 'com.android.support'
                   && !details.requested.name.contains('multidex')) {
               details.useVersion "${rootProject.ext.supportLibVersion}"
           }
       }
   }
}