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

Cloud Firestore 0.3.2 - Execution failed for task ':cloud_firestore:compileDebugJavaWithJavac' #15913

Closed
Diizzayy opened this issue Mar 24, 2018 · 2 comments

Comments

@Diizzayy
Copy link

Diizzayy commented Mar 24, 2018

I've been using Flutter for a few weeks now and i finally feel comfortable to start recreating my project using it. I recently tried adding the cloud firestore plugin version 0.3.2 and encountered this compile error.

Logs

C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:557: error: cannot inherit from final StandardMessageCodec
final class FirestoreMessageCodec extends StandardMessageCodec {
                                          ^
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:67: 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\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:557: error: StandardMessageCodec() has private access in StandardMessageCodec
final class FirestoreMessageCodec extends StandardMessageCodec {
      ^
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:564: error: method does not override or implement a method from a supertype
  @Override
  ^
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:568: error: cannot find symbol
      writeLong(stream, ((Date) value).getTime());
      ^
  symbol:   method writeLong(ByteArrayOutputStream,long)
  location: class FirestoreMessageCodec
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:571: error: cannot find symbol
      writeAlignment(stream, 8);
      ^
  symbol:   method writeAlignment(ByteArrayOutputStream,int)
  location: class FirestoreMessageCodec
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:572: error: cannot find symbol
      writeDouble(stream, ((GeoPoint) value).getLatitude());
      ^
  symbol:   method writeDouble(ByteArrayOutputStream,double)
  location: class FirestoreMessageCodec
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:573: error: cannot find symbol
      writeDouble(stream, ((GeoPoint) value).getLongitude());
      ^
  symbol:   method writeDouble(ByteArrayOutputStream,double)
  location: class FirestoreMessageCodec
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:576: error: cannot find symbol
      writeBytes(stream, ((DocumentReference) value).getPath().getBytes(UTF8));
      ^
  symbol:   method writeBytes(ByteArrayOutputStream,byte[])
  location: class FirestoreMessageCodec
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:578: error: writeValue(ByteArrayOutputStream,Object) is not public in StandardMessageCodec; cannot be accessed from outside package
      super.writeValue(stream, value);
           ^
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:582: error: method does not override or implement a method from a supertype
  @Override
  ^
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:588: error: cannot find symbol
        readAlignment(buffer, 8);
        ^
  symbol:   method readAlignment(ByteBuffer,int)
  location: class FirestoreMessageCodec
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:591: error: cannot find symbol
        final byte[] bytes = readBytes(buffer);
                             ^
  symbol:   method readBytes(ByteBuffer)
  location: class FirestoreMessageCodec
C:\Users\diizz\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.3.2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:595: error: cannot find symbol
        return super.readValueOfType(type, buffer);
                    ^
  symbol: method readValueOfType(byte,ByteBuffer)
Note: C:\Users\diizz\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.

* 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 26s
Finished with error: Gradle build failed: 1

Flutter Doctor

[√] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.16299.125], locale en-US)
    • Flutter version 0.1.5 at C:\flutter
    • Framework revision 3ea4d06340 (4 weeks ago), 2018-02-22 11:12:39 -0800
    • Engine revision ead227f118
    • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at C:\Users\diizz\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Android Studio (version 3.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
@Diizzayy Diizzayy reopened this Mar 24, 2018
@Diizzayy
Copy link
Author

For anyone else who encounters this, just channel the flutter channel from 'beta' to 'master' using the command: flutter channel master.
It should work fine after that

@github-actions
Copy link

github-actions bot commented Sep 1, 2021

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 Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant