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

Compilation error on Flutter #30

Open
emzee1 opened this issue Jun 29, 2022 · 1 comment
Open

Compilation error on Flutter #30

emzee1 opened this issue Jun 29, 2022 · 1 comment

Comments

@emzee1
Copy link

emzee1 commented Jun 29, 2022

Hi Jexos
Its awesome app. I intend to do a little modifications, but the app is not compiling on flutter. Initially it is giving error of embedding version, and later fails to compile on a complex error. Can you guide about compilation?
detail error is as under:
flutter build apk --release --ignore-deprecation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

/home/asmi/snap/khanos/android/app/src/main/AndroidManifest.xml uses android:name="io.flutter.app.FlutterApplication"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Running "flutter pub get" in khanos... 11.0s
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

../flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/boardview-0.2.2/lib/board_item.dart:92:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
WidgetsBinding.instance!
^
../flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/boardview-0.2.2/lib/boardview.dart:307:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
WidgetsBinding.instance!.addPostFrameCallback((Duration duration) {
^
../flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/boardview-0.2.2/lib/boardview.dart:569:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
^
../flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:311:32: Warning: Operand of null-aware operation '??' has type 'Color' which excludes null.
'Color' is from 'dart:ui'.
color: theme.backgroundColor ?? Colors.white,
^
../flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/provider-5.0.0/lib/src/inherited_provider.dart:391:26: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../flutter/common/flutter/packages/flutter/lib/src/scheduler/binding.dart').
SchedulerBinding.instance!.addPostFrameCallback((_) {
^
../flutter/common/flutter/.pub-cache/git/GradientAppBar-37c4b1bea68eebaf29627cc696fcf8ed4701592e/lib/gradient_app_bar.dart:421:47: Error: The getter 'title' isn't defined for the class 'TextTheme'.
'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../flutter/common/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'title'.
TextStyle centerStyle = widget.textTheme?.title ??
^^^^^
../flutter/common/flutter/.pub-cache/git/GradientAppBar-37c4b1bea68eebaf29627cc696fcf8ed4701592e/lib/gradient_app_bar.dart:422:32: Error: The getter 'title' isn't defined for the class 'TextTheme'.
'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../flutter/common/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'title'.
appBarTheme.textTheme?.title ??
^^^^^
../flutter/common/flutter/.pub-cache/git/GradientAppBar-37c4b1bea68eebaf29627cc696fcf8ed4701592e/lib/gradient_app_bar.dart:423:36: Error: The getter 'title' isn't defined for the class 'TextTheme'.
'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../flutter/common/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'title'.
themeData.primaryTextTheme.title;
^^^^^
../flutter/common/flutter/.pub-cache/git/GradientAppBar-37c4b1bea68eebaf29627cc696fcf8ed4701592e/lib/gradient_app_bar.dart:424:45: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../flutter/common/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'.
TextStyle sideStyle = widget.textTheme?.body1 ??
^^^^^
../flutter/common/flutter/.pub-cache/git/GradientAppBar-37c4b1bea68eebaf29627cc696fcf8ed4701592e/lib/gradient_app_bar.dart:425:32: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../flutter/common/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'.
appBarTheme.textTheme?.body1 ??
^^^^^
../flutter/common/flutter/.pub-cache/git/GradientAppBar-37c4b1bea68eebaf29627cc696fcf8ed4701592e/lib/gradient_app_bar.dart:426:36: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../flutter/common/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'.
themeData.primaryTextTheme.body1;
^^^^^
../flutter/common/flutter/.pub-cache/git/GradientAppBar-37c4b1bea68eebaf29627cc696fcf8ed4701592e/lib/gradient_app_bar.dart:1177:9: Error: No named parameter with the name 'vsync'.
vsync: this,
^^^^^
../flutter/common/flutter/packages/flutter/lib/src/rendering/sliver_persistent_header.dart:500:3: Context: Found this candidate, but the arguments don't match.
FloatingHeaderSnapConfiguration({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib/src/interface/local_platform.dart:46:19: Error: Member not found: 'packageRoot'.
io.Platform.packageRoot; // ignore: deprecated_member_use
^^^^^^^^^^^
FAILURE: Build failed with an exception.

Where:
Script '/home/asmi/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1156

What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.

Process 'command '/home/asmi/snap/flutter/common/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 2m 45s
Running Gradle task 'assembleRelease'... 167.4s
Gradle task assembleRelease failed with exit code 1

@tripleFA
Copy link

tripleFA commented Aug 3, 2022

Hi,
I managed to build the app by changing the gradient_app_bar dependency to new_gradient_app_bar.
Here is the diff file :

diff.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants