I have been trying to clone and run this time-messenger app from GitHub. But I keep getting this error. I tried flutter doctor, flutter clean, flutter build apk (which also gave an error), flutter pub cache repair, flutter pub get and so on but it didn't work.
This is the error I'm getting:
punreachrany#Punreachs-MacBook-Pro timy-messenger-master % flutter run
Using hardware rendering with device sdk gphone x86 arm. If you get graphics
artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Compiler message:
../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_w
idgets-0.20.2/lib/src/platform_scaffold.dart:229:38: Error: The getter
'fullObstruction' isn't defined for the class 'ObstructingPreferredSizeWidget'.
- 'ObstructingPreferredSizeWidget' is from
'package:flutter/src/cupertino/page_scaffold.dart'
('../../../Developer/flutter/packages/flutter/lib/src/cupertino/page_scaffold.d
art').
Try correcting the name to the name of an existing getter, or defining a getter
or field named 'fullObstruction'.
final obstruct = navigationBar.fullObstruction == null ||
^^^^^^^^^^^^^^^
../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_w
idgets-0.20.2/lib/src/platform_scaffold.dart:230:25: Error: The getter
'fullObstruction' isn't defined for the class 'ObstructingPreferredSizeWidget'.
- 'ObstructingPreferredSizeWidget' is from
'package:flutter/src/cupertino/page_scaffold.dart'
('../../../Developer/flutter/packages/flutter/lib/src/cupertino/page_scaffold.d
art').
Try correcting the name to the name of an existing getter, or defining a getter
or field named 'fullObstruction'.
navigationBar.fullObstruction;
^^^^^^^^^^^^^^^
Compiler message:
../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-0.20.2/lib/src/platform_scaffold.dart:229:38: Error: The getter 'fullObstruction' isn't defined for the class 'ObstructingPreferredSizeWidget'.
- 'ObstructingPreferredSizeWidget' is from 'package:flutter/src/cupertino/page_scaffold.dart' ('../../../Developer/flutter/packages/flutter/lib/src/cupertino/page_scaffold.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'fullObstruction'.
final obstruct = navigationBar.fullObstruction == null ||
^^^^^^^^^^^^^^^
../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-0.20.2/lib/src/platform_scaffold.dart:230:25: Error: The getter 'fullObstruction' isn't defined for the class 'ObstructingPreferredSizeWidget'.
- 'ObstructingPreferredSizeWidget' is from 'package:flutter/src/cupertino/page_scaffold.dart' ('../../../Developer/flutter/packages/flutter/lib/src/cupertino/page_scaffold.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'fullObstruction'.
navigationBar.fullObstruction;
^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/punreachrany/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 882
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/punreachrany/Developer/flutter/bin/flutter'' finished with non-zero exit value 1
* 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 9s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 9,7s
Exception: Gradle task assembleDebug failed with exit code 1
punreachrany#Punreachs-MacBook-Pro timy-messenger-master %
What can I try next?
Project Link : https://github.com/janoodleFTW/timy-messenger
Change the version number of flutter_platform_widgets to ^0.32.4 in pubspec.yaml, then run flutter packages upgrade
Source
Related
**FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':cloud_firestore'.
Could not load compiled classes for build file 'C:\src\flutter.pub-cache\hosted\pub.dartlang.org\cloud_firestore-3.1.12\android\build.gradle' from cache.
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':cloud_firestore' of type org.gradle.api.Project.
Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Could not get unknown property 'android' for project ':cloud_firestore' of type org.gradle.api.Project.
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 3s
Exception: Gradle task assembleDebug failed with exit code 1**
my current flutter project which uses the following firebase packages
cloud_firestore: ^3.1.12
firebase_core: ^1.14.1
firebase_auth: ^3.3.14
firebase_storage: ^10.2.12
firebase_messaging: ^11.2.13
I attached what I got in debug console when I try to run my app.
These are my firebase dependencies
firebase_core: ^1.12.0
firebase_auth: ^3.3.8
cloud_firestore: ^3.1.9
Launching lib\main.dart on ***** in debug mode...
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:14:11: Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(exception, stackTrace);
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:17:9: Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:12:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
Never convertPlatformException(Object exception, StackTrace stackTrace) {
^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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 21s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I have tried many methods, But they didn't work.
try flutter clean and then flutter run it work for me
flutter version 2.10.4
My first guess is that you might not finish platform-specific installation/setup for Firebase as well as Firebase plugins.
Just to verify that You can visit the FlutterFire website which will guide you through the installation steps for the targeting platforms for Firebase and plugin setup;
Otherwise, the flutter clean and flutter pub get should do the trick.
However, a problem still exists, you can restart your editor and just run the command flutter pub get/ flutter pub upgrade.
I have a firebase user app that let the users sign up and show their data and edit it. This error happens when I try to run the app on the emulator.
I wrote most of this app on sdk 2.11.0 then changed to 2.12.0 to suit null safety yet, I don't know if this is the reason.
The error:
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:19: error: cannot find symbol
import com.google.firebase.firestore.LoadBundleTaskProgress;
^
symbol: class LoadBundleTaskProgress
location: package com.google.firebase.firestore
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:158: error: cannot find symbol
ByteArrayOutputStream stream, LoadBundleTaskProgress snapshot) {
^
symbol: class LoadBundleTaskProgress
location: class FlutterFirebaseFirestoreMessageCodec
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\streamhandler\LoadBundleStreamHandler.java:6: error: cannot find symbol
import com.google.firebase.firestore.LoadBundleTask;
^
symbol: class LoadBundleTask
location: package com.google.firebase.firestore
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:80: error: cannot find symbol
} else if (value instanceof LoadBundleTaskProgress) {
^
symbol: class LoadBundleTaskProgress
location: class FlutterFirebaseFirestoreMessageCodec
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:81: error: cannot find symbol
writeLoadBundleTaskProgress(stream, (LoadBundleTaskProgress) value);
^
symbol: class LoadBundleTaskProgress
location: class FlutterFirebaseFirestoreMessageCodec
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:166: error: package LoadBundleTaskProgress does not exist
LoadBundleTaskProgress.TaskState taskState = snapshot.getTaskState();
^
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:170: error: cannot find symbol
case RUNNING:
^
symbol: variable RUNNING
location: class FlutterFirebaseFirestoreMessageCodec
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:173: error: cannot find symbol
case SUCCESS:
^
symbol: variable SUCCESS
location: class FlutterFirebaseFirestoreMessageCodec
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:176: error: cannot find symbol
case ERROR:
^
symbol: variable ERROR
location: class FlutterFirebaseFirestoreMessageCodec
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:353: error: cannot find symbol
query = query.whereNotEqualTo(fieldPath, value);
^
symbol: method whereNotEqualTo(FieldPath,Object)
location: variable query of type Query
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:375: error: cannot find symbol
query = query.whereNotIn(fieldPath, listValues);
^
symbol: method whereNotIn(FieldPath,List<Object>)
location: variable query of type Query
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestoreMessageCodec.java:388: error: cannot find symbol
if (limitToLast != null) query = query.limitToLast(limitToLast.longValue());
^
symbol: method limitToLast(long)
location: variable query of type Query
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestorePlugin.java:292: error: cannot find symbol
Query query = Tasks.await(firestore.getNamedQuery(name));
^
symbol: method getNamedQuery(String)
location: variable firestore of type FirebaseFirestore
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\streamhandler\LoadBundleStreamHandler.java:25: error: cannot find symbol
LoadBundleTask task = firestore.loadBundle(bundle);
^
symbol: class LoadBundleTask
location: class LoadBundleStreamHandler
E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\streamhandler\LoadBundleStreamHandler.java:25: error: cannot find symbol
LoadBundleTask task = firestore.loadBundle(bundle);
^
symbol: method loadBundle(byte[])
location: variable firestore of type FirebaseFirestore
Note: E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\FlutterFirebaseFirestorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: E:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-2.5.3\android\src\main\java\io\flutter\plugins\firebase\firestore\streamhandler\TransactionStreamHandler.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
15 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 6s
Exception: Gradle task assembleDebug failed with exit code 1
This is a part of my pubspec.yaml file :
version: 1.0.0+1
environment:
sdk: ">=2.12.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: ^1.0.2
cloud_firestore: ^2.5.3
firebase_core: ^1.7.0
firebase_auth: ^3.1.3
flutter_spinkit: ^5.1.0
provider: ^6.0.1
firebase: ^9.0.2
dev_dependencies:
flutter_test:
sdk: flutter
I think it is related to the SDK update, the issue might be caused because some of your components don’t suit null safety and is solved by updating them to a version where they accept it. Here you can find related information about that issue and its possible solutions. These are the possible solutions:
Solution 1
As I updated my SDK version to null safety all we need to do is just update your firebase_messaging in pusbpec.yaml to version a that supports null-safety (for example: firebase_messaging: ^10.0.0), and call flutter pub get from terminal
Open pubspec.yaml file.
Get the latest version of firebase_messaging from here.
Updated to latest version.
Then flutter pub get.
That’s all.
Solution 2
First, get the latest versions of your firebase dependencies from pub.dev
Run the commands:
flutter pub upgrade
flutter pub get
flutter clean
Invalidate caches, restart and then try running the app.
In the solution 1 the firebase_messaging dependency is updated, I was looking for the exact dependency, which seems to be LoadBundleTaskProgress, but all I could find is that it was in the cloud_firestore plugin, and to install it you would need to do as follows:
Run this command:
With Flutter:
$ flutter pub add cloud_firestore
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
dependencies:
cloud_firestore: ^2.5.3
If you already tried this and the message is still showing you might need to check your imports as well.
I am getting this gradle error when running flutter project:
I am using code from github for flutter pdf view and also using firebase for it.
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+3/lib/src/path_provider_windows_real.dart:126:25: Error: The getter 'addressOf' isn't defined for the class 'GUID'.
- 'GUID' is from 'package:win32/src/structs.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.
knownFolderID.addressOf, KF_FLAG_DEFAULT, NULL, pathPtrPtr);
^^^^^^^^^
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf16.dart:16:7: Error: Struct 'Utf16' is empty. Empty structs are undefined behavior.
class Utf16 extends Struct {
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/allocation.dart:47:33: Error: Expected type 'T' to be a valid and instantiated subtype of 'NativeType'.
final int totalSize = count * sizeOf<T>();
^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Plz help me I have got these gradle errors many time.
Thanks
Delete the .idea folder , build folder and pubspec.lock file, then it will work just fine.
Good day,
I have modified the cordapp-tutorial demo application by modifying the gradle file \cordapp-tutorial\java-source\build.gradle. More specifically, I am adding a jar file to compile a 3rd party library. I'm making the following change to the build.gradle script
but it causes the following error for the M14 milestone release:
:java-source:configureCordappFatJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':java-source:configureCordappFatJar'.
Cannot invoke method contains() on null object
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I do not get this error when I am using milestone release M13
There was a bug in the 0.14.0 release of the Corda gradle plugins that caused this (a missing null check when checking with a dependency without a group).
The way to fix it would be to change the corda_gradle_plugins_version to 0.14.1.