Baseflow / flutter-permission-plugins

This repo contains a collection of permission related Flutter plugins which can be used to request permissions to access device resources in a cross-platform way.
https://baseflow.com
MIT License
52 stars 34 forks source link

Execution failed for task ':app:transformClassesWithMultidexlistForDebug' #3

Closed j3g closed 5 years ago

j3g commented 5 years ago

🐛 Bug Report

Launching lib/main.dart on Android SDK built for x86 in debug mode... Initializing gradle... Resolving dependencies... Running Gradle task 'assembleDebug'... D8: Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

FAILURE: Build failed with an exception.

BUILD FAILED in 10s


The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app. See https://goo.gl/CP92wY for more information on the problem and how to fix it.


Finished with error: Gradle task assembleDebug failed with exit code 1

Expected behavior

Reproduction steps

after adding location_permissions library I receive an error in the android build process

Configuration

environment: sdk: ">=2.1.0 <3.0.0"

dependencies: flutter: sdk: flutter

cupertino_icons: ^0.1.2 numberpicker: ^1.0.0 google_maps_flutter: ^0.5.5 location_permissions: ^1.0.2

dev_dependencies: flutter_test: sdk: flutter

Version: 1.x

Platform:

j3g commented 5 years ago

my apologies that bug report is kind of messy. basically when I add this flutter-permission-handlers library I get multi dex issues. I am new to flutter so I am using default (flutter generated) settings for gradle files. I tried 'flutter clean'. I tried "multiDexEnabled true" in build.gradle. I continue to troubleshoot. Some tips say it might be related to AndroidX, but again I'm using all default flutter build configs so I don't know why that would be the cause.

j3g commented 5 years ago

after adding defaultConfig { multiDexEnabled true } to build.properties I was receiving a different error: ':app:transformClassesWithMultidexlistForDebug', so I researched that. there are several multi dex issues open/closed: https://github.com/flutter/flutter/issues/23929 https://github.com/flutter/flutter/issues/23131

j3g commented 5 years ago

FIXED I added to location_permissions build.gradle

android {
    defaultConfig {
        multiDexEnabled true
}

I added to gradle.properties

android.useAndroidX=true
android.enableJetifier=true
mvanbeusekom commented 5 years ago

Thanks for the fix! I have merged your pull-request and will release a new version shortly