Git Product home page Git Product logo

Comments (10)

hnvn avatar hnvn commented on August 17, 2024

Could you show your build.gradle ?

from flutter_downloader.

derTuca avatar derTuca commented on August 17, 2024

Sure, it is as follows:

import com.google.gms.googleservices.GoogleServicesPlugin

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        applicationId "<APPLICATION-ID>"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }

}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "com.android.support:support-v4:28.0.0"
    implementation "com.android.support:appcompat-v7:28.0.0"
    implementation "com.android.support:cardview-v7:28.0.0"
    implementation "com.android.support:customtabs:28.0.0"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
GoogleServicesPlugin.config.disableVersionCheck = true

from flutter_downloader.

hnvn avatar hnvn commented on August 17, 2024

I've just published a new version that upgrades compileSdkVersion to 28. I try turning multiDexEnabled to true and example project works well. To be honest, I don't know what your issue comes from but I see your configuration of gradle contains some components from android support libraries, there're probably conflictions among them. You can try to upgrade to latest version of this plugin and let me know if the problem still occurs

from flutter_downloader.

derTuca avatar derTuca commented on August 17, 2024

I updated to the latest version and the issue still persists. I have created a new project and started adding my plugins one by one, and the conflicts seems to be with cloud_firestore (luckily the first one I tested). Could the Firebase SDK have conflicting components?

from flutter_downloader.

hnvn avatar hnvn commented on August 17, 2024

This issue is related to WorkManager dependency: https://issuetracker.google.com/issues/116154359

To work around it, place following code in your build.gradle file (in android folder, not app folder):

configurations.all {
    exclude group: 'com.google.guava', module: 'listenablefuture'
}

from flutter_downloader.

hnvn avatar hnvn commented on August 17, 2024

I will close this issue. You can re-open it if you need more help

from flutter_downloader.

derTuca avatar derTuca commented on August 17, 2024

I still get the same error:

com.android.build.api.transform.TransformException: Error while generating the main dex list.

I have tried the snipped you gave me and the one suggested in the answer, but none of them work. I have also tried excluding the module in the build.gradle of your plugin, but then the compilation would fail because it can't find the module (duh).

from flutter_downloader.

hnvn avatar hnvn commented on August 17, 2024

I've tried some ways to configure gradle file, but there's nothing worked. We may as well wait for the next release of Guava to resolve this issue.

from flutter_downloader.

hnvn avatar hnvn commented on August 17, 2024

I've just released a new version to deal with this issue. I've tested on the example project and it can be compiled with firebase libraries now. But to get it worked, you have to add some additional configuration in gradle file, add following codes in file build.gradle inside android folder:

configurations.all {
    exclude group: 'com.google.guava', module: 'failureaccess'

    resolutionStrategy {
         eachDependency { details ->
             if('guava' == details.requested.name) {
                 details.useVersion '27.0-android'
             }
          }
     }
}

from flutter_downloader.

hnvn avatar hnvn commented on August 17, 2024

@derTuca , Have you worked around this issue yet?

from flutter_downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.