1

I'm developing my app with firebase

But I have the following problem when I made Build the project

Error

My Module App Gradle is that

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "pt.ipca.projectoaddjn"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-vector-drawable:26.1.0'
    implementation 'com.google.firebase:firebase-database:11.0.4'
    implementation 'com.android.support:support-v4:26.1.0'
    compile 'com.google.firebase:firebase-core:11.0.4'
    compile 'com.google.firebase:firebase-auth:11.0.4'
    implementation 'com.android.support:cardview-v7:26.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:percent:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.firebaseui:firebase-ui:0.6.2'
}
apply plugin: 'com.google.gms.google-services'

And My project app is this

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

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.2.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

I do not know if the problem is in this compile 'com.firebaseui:firebase-ui:0.6.2' I just had this problem when I added this complile

Or the problem may be related to the fact that I have multiple compiles,.

Thanks.

Nuno Antunes
  • 49
  • 1
  • 2
  • 11
  • Possible duplicate of [Error converting bytecode to dex: Multiple dex files, Android Studio 3.0](https://stackoverflow.com/questions/46986592/error-converting-bytecode-to-dex-multiple-dex-files-android-studio-3-0) – Shaishav Jogani May 24 '18 at 00:21

1 Answers1

1

Change compile for implementation, compile has been deprecated.Finally, you should match the firebase version with the firebase ui version, see the github.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-vector-drawable:26.1.0'
    implementation 'com.google.firebase:firebase-database:11.4.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.google.firebase:firebase-core:11.4.0'
    implementation 'com.google.firebase:firebase-auth:11.4.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.android.support:percent:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.firebaseui:firebase-ui:2.4.0'
}
Levi Moreira
  • 11,917
  • 4
  • 32
  • 46
  • 1
    Thanks for the answer, I solved my problem with the code sent, I had to make a small change that was to change all implements 26.1.0 to 26.0.1 Thanks – Nuno Antunes May 24 '18 at 10:40