-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: crashStack traces logged to the consoleStack traces logged to the consoleplatform-androidAndroid applications specificallyAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
I am getting the following exception after upgrading my flutter. This is the exception I am getting. I tried removing items from my pubspec.yaml but I am still getting this.
Any suggestions would be helpful. I tried different approaches online but I am still stuck on this
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/os/ResultReceiver;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/os/ResultReceiver;
This is the detail of the exception
$ flutter run --debug
Using hardware rendering with device Android SDK built for x86. If you
get graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle... 1.9s
Resolving dependencies... 26.7s
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/os/ResultReceiver;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/os/ResultReceiver;
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/os/ResultReceiver;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/os/ResultReceiver;
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
This is what flutter doctor says:
$ flutter doctor -v
[✓] Flutter (Channel beta, v1.2.1, on Mac OS X 10.14.1 18B75, locale en-US)
• Flutter version 1.2.1 at /Users/adam/Flutter/flutter
• Framework revision 8661d8aecd (12 days ago), 2019-02-14 19:19:53 -0800
• Engine revision 3757390fa4
• Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/adam/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/adam/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 1.9.4
• CocoaPods version 1.5.0
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.1.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 24.0.2
• Dart plugin version 181.4445.29
[!] VS Code (version 1.30.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
! Doctor found issues in 1 category.
This is the app/build.gradle
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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28 //AndroidX
lintOptions {
disable 'InvalidPackage'
//--NOTE!!--
checkReleaseBuilds false
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.instagig.instagig"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
// This is the main section that I've updated
// to get the release APK to build
buildTypes {
release {
profile {
matchingFallbacks = ['debug', 'release']
}
// signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = trueThis is my pubspec.yaml
pubspec.yaml
name: xxxxxx
description: xxxxxx
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.0
http: "^0.11.3+16"
# Use package from github
progress_hud:
git: https://github.com/LampeMW/progress_hud/
flutter_spinkit: "^3.1.0"
crypto: any
validate: "^1.6.0"
json_annotation: ^0.2.4
# image_picker: "^0.4.1"
# firebase_messaging: ^2.1.0 #0.2.1
shared_preferences: ^0.4.3
device_info: ^0.2.1
geolocator: ^2.1.1
geocoder: ^0.1.2
cached_network_image: "^0.4.1"
mutex: #"^0.0.1"
logging: "^0.11.3+1"
uuid: ">=1.0.0"
web_socket_channel: ^1.0.9
after_layout: ^1.0.7
image_cropper: ^0.0.9
super_tooltip: ^0.9.0
keyboard_visibility: any
flutter_image_compress: ^0.2.4
dev_dependencies:
flutter_test:
sdk: flutter
build_runner:
json_serializable: ^0.5.2
flutter:
uses-material-design: true
assets:
- assets/img/logo.png
Metadata
Metadata
Assignees
Labels
c: crashStack traces logged to the consoleStack traces logged to the consoleplatform-androidAndroid applications specificallyAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.