Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure after upgrading to cloud_firestore 0.3.x #15972

Closed
isoos opened this issue Mar 27, 2018 · 33 comments
Closed

Build failure after upgrading to cloud_firestore 0.3.x #15972

isoos opened this issue Mar 27, 2018 · 33 comments
Labels
c: crash Stack traces logged to the console p: cloud_firestore Firebase Firestore plugin package flutter/packages repository. See also p: labels. platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@isoos
Copy link

isoos commented Mar 27, 2018

From @ITJammish on March 25, 2018 15:8

URL: https://pub.dartlang.org/packages/cloud_firestore#-readme-tab-

Hi, after upgrading to use the cloud firestore plugin 0.3.0 (and later) from 0.2.12. I have the following stacktrace on build:

Running "flutter packages get" in sampleproject...          0.6s
Launching lib/main.dart on Pixel 2 XL in debug mode...
Initializing gradle...                                0.7s
Resolving dependencies...                             0.9s
Running 'gradlew assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
57: error: cannot inherit from final StandardMessageCodec
final class FirestoreMessageCodec extends StandardMessageCodec {
                                          ^
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:6
7: error: constructor StandardMethodCodec in class StandardMethodCodec cannot be applied to given types;
            new StandardMethodCodec(FirestoreMessageCodec.INSTANCE));
            ^
  required: no arguments
  found: FirestoreMessageCodec
  reason: actual and formal argument lists differ in length
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
57: error: StandardMessageCodec() has private access in StandardMessageCodec
final class FirestoreMessageCodec extends StandardMessageCodec {
      ^
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
64: error: method does not override or implement a method from a supertype
  @Override
  ^
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
68: error: cannot find symbol
      writeLong(stream, ((Date) value).getTime());
      ^
  symbol:   method writeLong(ByteArrayOutputStream,long)
  location: class FirestoreMessageCodec
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
71: error: cannot find symbol
      writeAlignment(stream, 8);
      ^
  symbol:   method writeAlignment(ByteArrayOutputStream,int)
  location: class FirestoreMessageCodec
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
72: error: cannot find symbol
      writeDouble(stream, ((GeoPoint) value).getLatitude());
      ^
  symbol:   method writeDouble(ByteArrayOutputStream,double)
  location: class FirestoreMessageCodec
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
73: error: cannot find symbol
      writeDouble(stream, ((GeoPoint) value).getLongitude());
      ^
  symbol:   method writeDouble(ByteArrayOutputStream,double)
  location: class FirestoreMessageCodec
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
76: error: cannot find symbol
      writeBytes(stream, ((DocumentReference) value).getPath().getBytes(UTF8));
      ^
  symbol:   method writeBytes(ByteArrayOutputStream,byte[])
  location: class FirestoreMessageCodec
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
78: error: writeValue(ByteArrayOutputStream,Object) is not public in StandardMessageCodec; cannot be accessed from outside package
      super.writeValue(stream, value);
           ^
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
82: error: method does not override or implement a method from a supertype
  @Override
  ^
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
88: error: cannot find symbol
        readAlignment(buffer, 8);
        ^
  symbol:   method readAlignment(ByteBuffer,int)
  location: class FirestoreMessageCodec
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
91: error: cannot find symbol
        final byte[] bytes = readBytes(buffer);
                             ^
  symbol:   method readBytes(ByteBuffer)
  location: class FirestoreMessageCodec
C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:5
95: error: cannot find symbol
        return super.readValueOfType(type, buffer);
                    ^
  symbol: method readValueOfType(byte,ByteBuffer)
Note: C:\Users\...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.
java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
14 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cloud_firestore:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.16299.125], locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[√] Android Studio (version 3.0)
[√] Android Studio (version 3.0)
[√] IntelliJ IDEA Community Edition (version 2017.3)
[√] Connected devices (1 available)

• No issues found!

Copied from original issue: dart-lang/pub-dev#1146

@zoechi
Copy link
Contributor

zoechi commented Mar 27, 2018

I think you need to switch to the dev channel for the latest versions of plugins

@Skylled
Copy link
Contributor

Skylled commented Mar 27, 2018

The latest version of cloud_firestore depends on very recent changes to both Flutter and the Engine. You should be able to run flutter channel master or set your firestore dependency to 0.3.0

@ITJammish
Copy link

Thanks guys, that would make a tonne of sense. I'm going to hold off upgrading for now and stick to safer waters. Thank you again.

@ramlok
Copy link

ramlok commented Mar 31, 2018

I have the same problem, unfortunately nothing mentioned above helped me.
my libraries:

  image_picker: 0.1.1
  google_sign_in: 0.3.1
  firebase_analytics: 0.0.4
  firebase_auth: 0.2.0
  firebase_database: 0.0.12
  firebase_storage: 0.0.5
  cloud_firestore: 0.3.2

When I change to master channel, I get

_Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex_

Changing the cloud_firestore to 0.3.0 will raise another dex exception

I am just starting with Flutter. Do I need to allow multidex in Android, or will flutter solve this?
Should I change back to beta channel, or dev channel?

@iampawan
Copy link

iampawan commented Apr 1, 2018

+1 ( Anyone found the solution ?, Also changing channel didnt work for me)

@zoechi
Copy link
Contributor

zoechi commented Apr 1, 2018

please provide at least the output of flutter doctor -v if you expect to get support.

@iampawan
Copy link

iampawan commented Apr 1, 2018

No issue found @zoechi

[✓] Flutter (Channel master, v0.2.7-pre.5, on Mac OS X 10.13.3 17D102, locale en-IN)
    • Flutter version 0.2.7-pre.5 at /Users/pawankumar/Desktop/flutter/flutter
    • Framework revision 68db514ec0 (30 hours ago), 2018-03-30 19:48:51 -0700
    • Engine revision c903c217a1
    • Dart version 2.0.0-dev.43.0.flutter-52afcba357

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/pawankumar/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • 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-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3, Build version 9E145
    • ios-deploy 1.9.2
    • CocoaPods version 1.3.1

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2017.3.5)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 23.1.2
    • Dart plugin version 173.4700

[✓] Connected devices (2 available)
    • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 8.0.0 (API 26) (emulator)
    • iPhone X                  • 6CC56568-E5AC-4347-B026-53018C7299D8 • ios         • iOS 11.3 (simulator)

• No issues found!

@vbandrade
Copy link

hey @iampawan, have you found a solution for this? I'm also stuck with the :app:transformDexArchiveWithExternalLibsDexMergerForDebug problem.
doctor shows no issues.
have connected to firestore before, but cant after updating. :(

love your videos, man! thanks for putting them out!

@zoechi
Copy link
Contributor

zoechi commented Jun 7, 2018

similar to #14874

@matejthetree
Copy link

matejthetree commented Jun 9, 2018

I have the same issue. Tried downgrading but I get the same on 0.7.1 and 0.7.2

flutter doctor -v

flutter doctor -v
[✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.13.4 17E202, locale en-HR)
    • Flutter version 0.4.4 at /Users/matejsimunic/Work/dart/flutter
    • Framework revision f9bb4289e9 (4 weeks ago), 2018-05-11 21:44:54 -0700
    • Engine revision 06afdfe54e
    • Dart version 2.0.0-dev.54.0.flutter-46ab040e58

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/matejsimunic/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /Users/matejsimunic/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-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3, Build version 9E145
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 24.2.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 25.0.2
    • Dart plugin version 181.4892.1

[✓] Connected devices (2 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
    • SM J500F                  • 3430d201      • android-arm • Android 6.0.1 (API 23)

• No issues found!
Note: /Users/matejsimunic/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.1/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/matejsimunic/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.11/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/matejsimunic/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.4/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/Users/matejsimunic/.pub-cache/hosted/pub.dartlang.org/firebase_storage-0.3.7/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java:264: warning: [deprecation] getDownloadUrl() in UploadTask.TaskSnapshot has been deprecated
            result.success(snapshot.getDownloadUrl().toString());
                                   ^
/Users/matejsimunic/.pub-cache/hosted/pub.dartlang.org/firebase_storage-0.3.7/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java:284: warning: [unchecked] unchecked cast
    Map<String, String> customMetadata = (Map<String, String>) map.get("customMetadata");
                                                                      ^
  required: Map<String,String>
  found:    Object
2 warnings

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

* 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

BUILD FAILED in 32s
Finished with error: Gradle build failed: 1

@matejthetree
Copy link

It works fine on ios

@gmlewis
Copy link

gmlewis commented Aug 13, 2018

Every time I run a flutter upgrade I run into this problem on Android, so I typically revert my changes to pubspec.lock and then things work again.

But this time, I switched from flutter channel beta to flutter channel master (which also runs a flutter upgrade) and both the old pubspec.lock and the new pubspec.lock exhibit the same problem. So at this point, I'm unable to build for Android on the master channel.

$ flutter doctor -v
[✓] Flutter (Channel master, v0.5.9-pre.24, on Mac OS X 10.13.4 17E199, locale en-US)
    • Flutter version 0.5.9-pre.24 at /Users/lewig047/tools/flutter
    • Framework revision e69b434602 (7 hours ago), 2018-08-13 10:35:59 +0200
    • Engine revision e54bc4ea18
    • Dart version 2.0.0-dev.69.5.flutter-eab492385c

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/lewig047/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • 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-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4, Build version 9F1027a
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.23.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.12.2

[✓] Connected devices (2 available)
    • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 8.1.0 (API 27) (emulator)
    • iPhone X                  • D253C7DC-FA97-4A56-8B52-0A5A24CC38AB • ios         • iOS 11.4 (simulator)

• No issues found!
$ flutter run -d Android
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...                                       0.9s
Resolving dependencies...                                    1.1s
Running 'gradlew assembleDebug'...
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.4/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.1.6/android/src/main/java/com/flutter_webview_plugin/WebviewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.18/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.18/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-1.0.4/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseInstanceIDService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

* 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

BUILD FAILED in 28s
29.0s
Gradle build failed: 1

@zoechi zoechi added c: crash Stack traces logged to the console plugin labels Aug 15, 2018
@collinkueter
Copy link

I am receiving a similar error, it happens on all flutter branch releases versions.

D8: Cannot fit requested classes in a single dex file. Try supplying a main-dex list.
# methods: 65912 > 65536

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/3.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/4.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/5.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/6.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/7.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/8.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/9.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/10.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/11.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/12.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/13.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/14.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/15.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/16.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/17.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/18.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/19.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/20.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/21.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/22.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/23.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/24.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/25.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/26.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/27.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/28.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/29.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/30.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/31.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/32.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/33.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/34.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/35.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/36.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/37.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/38.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/39.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/40.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/41.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/42.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/43.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/44.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/45.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/46.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/47.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/48.jar, /Users/collinkueter/development/projects/flutter/rep_break_repeat/build/app/intermediates/transforms/dexBuilder/debug/49.jar
  The number of method references in a .dex file cannot exceed 64K.
  Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 28s
Finished with error: Gradle build failed: 1

Flutter Doctor:

[✓] Flutter (Channel dev, v0.7.0, on Mac OS X 10.13.6 17G65, locale en-US)
    • Flutter version 0.7.0 at /Users/_________/development/libraries/flutter
    • Framework revision 09fe34708f (5 days ago), 2018-08-22 10:20:51 -0700
    • Engine revision 4b271b2e02
    • Dart version 2.1.0-dev.1.0.flutter-69fce633b7

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/collinkueter/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • 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-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[!] IntelliJ IDEA Community Edition (version 2018.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.26.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.17.1

[✓] Connected devices (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

! Doctor found issues in 1 category.

Dependencies:

  flutter:
    sdk: flutter
    cupertino_icons: ^0.1.2
    cloud_firestore: ^0.7.4
    firebase_auth: ^0.5.18
    firebase_analytics: ^1.0.2
    flutter_redux: ^0.5.2
    redux: ^3.0.0
    validate: ^1.6.1
    redux_logging: ^0.3.0

@vbandrade
Copy link

after the release of Beta 0.6, and using changing minSdkVersion to 21 according to this comment, it is working in my app.

@Pareshoct7
Copy link

Pareshoct7 commented Oct 11, 2018

I am receiving a similar error, it happens on all flutter branch releases versions. I am stuck anyone having the solution?

Note: C:\Users\iqor\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.7.4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\iqor\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_auth-0.5.20\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\iqor\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_auth-0.5.20\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\iqor\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_core-0.2.5+1\android\src\main\java\io\flutter\plugins\firebase\core\FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
C:\Users\iqor\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_storage-1.0.3\android\src\main\java\io\flutter\plugins\firebase\storage\FirebaseStoragePlugin.java:288: warning: [unchecked] unchecked cast
    Map<String, String> customMetadata = (Map<String, String>) map.get("customMetadata");
                                                                      ^
  required: Map<String,String>
  found:    Object
1 warning
e: C:\Users\iqor\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\google_places_picker-0.0.6\android\src\main\kotlin\com\theantimony\googleplacespicker\GooglePlacesPickerPlugin.kt: (44, 35): Type inference failed. Expected type mismatch: inferred type is Int? but Int was expected

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':google_places_picker:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 22s
Finished with error: Gradle task assembleDebug failed with exit code 1

@Pareshoct7
Copy link

Every time I run a flutter upgrade I run into this problem on Android, so I typically revert my changes to pubspec.lock and then things work again.

But this time, I switched from flutter channel beta to flutter channel master (which also runs a flutter upgrade) and both the old pubspec.lock and the new pubspec.lock exhibit the same problem. So at this point, I'm unable to build for Android on the master channel.

$ flutter doctor -v
[✓] Flutter (Channel master, v0.5.9-pre.24, on Mac OS X 10.13.4 17E199, locale en-US)
    • Flutter version 0.5.9-pre.24 at /Users/lewig047/tools/flutter
    • Framework revision e69b434602 (7 hours ago), 2018-08-13 10:35:59 +0200
    • Engine revision e54bc4ea18
    • Dart version 2.0.0-dev.69.5.flutter-eab492385c

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/lewig047/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • 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-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4, Build version 9F1027a
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.23.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.12.2

[✓] Connected devices (2 available)
    • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 8.1.0 (API 27) (emulator)
    • iPhone X                  • D253C7DC-FA97-4A56-8B52-0A5A24CC38AB • ios         • iOS 11.4 (simulator)

• No issues found!
$ flutter run -d Android
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...                                       0.9s
Resolving dependencies...                                    1.1s
Running 'gradlew assembleDebug'...
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.4/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.1.6/android/src/main/java/com/flutter_webview_plugin/WebviewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.18/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.18/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/lewig047/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-1.0.4/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseInstanceIDService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

* 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

BUILD FAILED in 28s
29.0s
Gradle build failed: 1

@gmlewis You got any solution for this?

@gmlewis
Copy link

gmlewis commented Oct 11, 2018

No, not really. It eventually cleared up and I'm now back up and running again. Sorry.

@Pareshoct7
Copy link

No, not really. It eventually cleared up and I'm now back up and running again. Sorry.

Thanks for the quick response. I am stuck actually so I asked you. anyway I have to wait for the reply from the contributor of flutter team

@Pareshoct7
Copy link

@zoechi Sorry to bother you but You found any concrete solution for this issue? I am stuck with this.

@zoechi
Copy link
Contributor

zoechi commented Oct 15, 2018

New versions of several plugins were released last week. Ensure you have the latest versions.

@Pareshoct7
Copy link

Yes I have all the latest plugins see following are they

google_sign_in: ^3.2.1
  firebase_auth: ^0.6.2+1
  firebase_core: ^0.2.5+1
  firebase_database: ^1.0.5
  firebase_storage: ^1.0.4
  cloud_firestore: ^0.8.1+1
  flutter_facebook_login: ^1.1.1
  intl: ^0.15.7
  geocoder: ^0.1.1
  image_picker: ^0.4.10
  shared_preferences: ^0.4.3
  codable: ^1.0.0
  flutter_staggered_grid_view: ^0.2.2
  fluttertoast: ^2.0.9
  cached_network_image: ^0.5.0
  firebase_messaging: ^2.0.1
  dio: ^1.0.6
  flutter_local_notifications: ^0.3.9
  time_machine: ^0.9.4
  google_places_picker: ^0.0.6

@zoechi
Copy link
Contributor

zoechi commented Oct 15, 2018

I'd try deleting ios/ and android and run flutter create . in the project directory to ensure the files contain changes for the latest Flutter version.
Ensure you re-apply manual changes you made (should be easy when you use version control like Git)

@Pareshoct7
Copy link

Pareshoct7 commented Oct 15, 2018

@zoechi I got the solution.
The solution is I removed the following
google_places_picker: ^0.0.6

But Now new Issue occurred that the app is not working in Android API 18

@gmlewis
Copy link

gmlewis commented Oct 15, 2018

If you are seeing the Unable to merge dex issue, then this is what worked for me:

In android/build.gradle, make sure you have this at the bottom:

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                && !details.requested.name.contains('multidex') ) {
                details.useVersion "26.1.0"
            }
        }
    }
}

In android/app/build.gradle, make sure you have these parts:

android {
    ...
    defaultConfig {
        ...
        minSdkVersion 19
        targetSdkVersion 27
        multiDexEnabled true
        ...
    }
    ....
}
...
dependencies {
    ....
    compile 'com.android.support:multidex:1.0.0'
}

That solved the multidex issue for me. I hope that helps.

@Pareshoct7
Copy link

@gmlewis Thanks for the answer. But I already put this code and still not able to run the app in Android 18. Also, I am again getting the following error. Is there any solution then please let me know. I stuck in this from past one week.

#15972 (comment)

@gmlewis
Copy link

gmlewis commented Oct 16, 2018

C:\Users\iqor\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_storage-1.0.3\android\src\main\java\io\flutter\plugins\firebase\storage\FirebaseStoragePlugin.java:288: warning: [unchecked] unchecked cast
    Map<String, String> customMetadata = (Map<String, String>) map.get("customMetadata");
                                                                      ^
  required: Map<String,String>
  found:    Object

sounds like a type mismatch. If that data came from JSON, then you need to build up a new map from the original data.

But this would be a completely separate issue from the subject line above and I recommend that you move that question out of this issue and ask for help on the Dart or Flutter Slack channels where there are a lot of helpful people hanging out for questions like this.

@Pareshoct7
Copy link

@gmlewis I think this is the correct place for this issue and as you see there is an error with FirebaseStoragePlugin.java So, we are not creating any map that is handled internally in firebase storage plugin. Not sure how to solve it or what is wrong with this.

@zoechi zoechi added p: cloud_firestore Firebase Firestore plugin platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: gradle "flutter build" and "flutter run" on Android labels Jan 4, 2019
@zoechi zoechi added this to the Goals milestone Jan 8, 2019
@ened
Copy link
Contributor

ened commented Mar 15, 2019

@isoos please confirm if this issue still appears with latest Flutter & cloud_firestore plugin versions & post pubspec.yaml/lock + output of flutter doctor -v if not.

@isoos
Copy link
Author

isoos commented Mar 15, 2019

0.3.0 (the version which had the issue at the time of reporting) seems to be fine with the latest Flutter:
https://pub.dartlang.org/packages/cloud_firestore/versions/0.3.0#-analysis-tab-

@isoos isoos closed this as completed Mar 15, 2019
@larssn
Copy link

larssn commented Apr 15, 2019

It still happens for us.

flutter doctor -v
[✓] Flutter (Channel dev, v1.4.19, on Mac OS X 10.13.6 17G6030, locale en-DK)
• Flutter version 1.4.19
• Framework revision 6c7b683 (3 days ago), 2019-04-12 10:40:18 -0400
• Engine revision 9aa7c9a
• Dart version 2.2.1 (build 2.2.1-dev.4.2 None)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /usr/local/share/android-sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /usr/local/share/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.3

[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.3.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] VS Code (version 1.33.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.25.0

[✓] Connected device (1 available)
• SM J510FN • 5d78ec18 • android-arm • Android 7.1.1 (API 25)

• No issues found!

pubspec.yaml

name: test_app
description: Test
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

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.2
  cloud_firestore: ^0.9.13+1
  equatable: ^0.2.3
  built_value: ^6.4.0
  rxdart: ^0.21.0
  flutter_material_color_picker: ^0.0.5
  uuid: ^2.0.1

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: ^1.3.1
  built_value_generator: ^6.4.0

dependency_overrides:
  analyzer: ^0.36.0

# The following section is specific to Flutter.
flutter:
  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

@kroikie
Copy link

kroikie commented Oct 13, 2019

@isoos

This issue has been moved to firebase/flutterfire#1244. Any further collaboration will be done there.

@mulenatni
Copy link

am going to crazy. i stack on this problem the last 2 weeks please help me

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console p: cloud_firestore Firebase Firestore plugin package flutter/packages repository. See also p: labels. platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests