-
Notifications
You must be signed in to change notification settings - Fork 1.5k
building gallery for Android with local engine fails #899
Comments
Hi taha@pop-os:~/Documents/gallery$ fm run --local-engine-src-path /home/taha/Code/engine/src --local-engine=android_debug_unopt_arm64
Launching lib/main.dart on Redmi K20 Pro in debug mode...
Shrinking has been disabled for this build due to deferred components. Shrinking is not available for multi-apk applications.
This limitation is expected to be removed when Gradle plugin 4.2+ is available in Flutter.
Running Gradle task 'assembleDebug'... 21.7s
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
E/flutter (32246): [ERROR:flutter/shell/common/shell.cc(906)] Embedding reported invalid ViewportMetrics, ignoring update.
E/flutter (32246): physical_width: 0
E/flutter (32246): physical_height: 0
E/flutter (32246): device_pixel_ratio: 2.75
E/flutter (32246): [ERROR:flutter/shell/common/shell.cc(906)] Embedding reported invalid ViewportMetrics, ignoring update.
E/flutter (32246): physical_width: 0
E/flutter (32246): physical_height: 0
E/flutter (32246): device_pixel_ratio: 2.75
Syncing files to device Redmi K20 Pro... 1,136ms
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
Running with unsound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
An Observatory debugger and profiler on Redmi K20 Pro is available at: http://127.0.0.1:45019/IMn7aQ3JrxQ=/
The Flutter DevTools debugger and profiler on Redmi K20 Pro is available at:
http://127.0.0.1:9100?uri=http%3A%2F%2F127.0.0.1%3A45019%2FIMn7aQ3JrxQ%3D%2F flutter doctor -v
I couldn't run profile mode |
As a workaround, try adding this to the
|
How did you build the profile engine? You need something like: $ flutter/tools/gn --runtime-mode profile
$ ninja -C out/host_profile
$ flutter/tools/gn --runtime-mode profile --android --android-cpu arm64
$ ninja -C out/android_profile_arm64
Thanks @jason-simmons this indeed makes it build. Any idea why is this not part of the default template? |
Hi @mraleph I can confirm the issue logs[ +576 ms] [ +655 ms] aot_android_asset_bundle: Complete
[+1300 ms] [+1223 ms] Skipping target: android_aot_bundle_profile_android-arm64
[ ] [ ] Persisting file store
[ ] [ +30 ms] Done persisting file store
[ +99 ms] [ +47 ms] build succeeded.
[ ] [ +25 ms] "flutter assemble" took 65,067ms.
[ +199 ms] [ +257 ms] ensureAnalyticsSent: 251ms
[ ] [ +9 ms] Running shutdown hooks
[ ] [ ] Shutdown hooks complete
[ +99 ms] [ +1 ms] exiting with code 0
[ +399 ms] > Task :app:packLibsflutterBuildProfile UP-TO-DATE
[ ] > Task :package_info_plus:preBuild UP-TO-DATE
[ ] > Task :package_info_plus:preDebugBuild UP-TO-DATE
[ ] > Task :package_info_plus:processDebugJavaRes NO-SOURCE
[ ] > Task :package_info_plus:bundleLibResDebug NO-SOURCE
[ ] > Task :package_info_plus:compileDebugAidl NO-SOURCE
[ ] > Task :package_info_plus:compileDebugRenderscript NO-SOURCE
[ ] > Task :package_info_plus:generateDebugBuildConfig UP-TO-DATE
[ ] > Task :package_info_plus:generateDebugResValues UP-TO-DATE
[ ] > Task :package_info_plus:generateDebugResources UP-TO-DATE
[ ] > Task :package_info_plus:packageDebugResources UP-TO-DATE
[ +97 ms] > Task :package_info_plus:parseDebugLocalResources UP-TO-DATE
[ ] > Task :package_info_plus:processDebugManifest UP-TO-DATE
[ ] > Task :package_info_plus:javaPreCompileDebug UP-TO-DATE
[ ] > Task :path_provider:preBuild UP-TO-DATE
[ ] > Task :path_provider:preDebugBuild UP-TO-DATE
[ ] > Task :path_provider:processDebugJavaRes NO-SOURCE
[ ] > Task :path_provider:bundleLibResDebug NO-SOURCE
[ ] > Task :path_provider:compileDebugAidl NO-SOURCE
[ ] > Task :path_provider:compileDebugRenderscript NO-SOURCE
[ ] > Task :path_provider:generateDebugBuildConfig UP-TO-DATE
[ +3 ms] > Task :path_provider:generateDebugResValues UP-TO-DATE
[ ] > Task :path_provider:generateDebugResources UP-TO-DATE
[ ] > Task :path_provider:packageDebugResources UP-TO-DATE
[ ] > Task :package_info_plus:generateDebugRFile
[ ] > Task :path_provider:parseDebugLocalResources UP-TO-DATE
[ +197 ms] > Task :package_info_plus:compileDebugJavaWithJavac FAILED
[ ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ ] Use '--warning-mode all' to show the individual deprecation warnings.
[ ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[ ] 14 actionable tasks: 3 executed, 11 up-to-date
[ +1 ms]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:11: error: package io.flutter.embedding.engine.plugins does not exist
[ +2 ms] import io.flutter.embedding.engine.plugins.FlutterPlugin;
[ ] ^
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:12: error: package io.flutter.plugin.common does not exist
[ ] import io.flutter.plugin.common.BinaryMessenger;
[ ] ^
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:13: error: package io.flutter.plugin.common does not exist
[ ] import io.flutter.plugin.common.MethodCall;
[ ] ^
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:14: error: package io.flutter.plugin.common does not exist
[ ] import io.flutter.plugin.common.MethodChannel;
[ ] ^
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:15: error: package io.flutter.plugin.common.MethodChannel does not exist
[ +12 ms] import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
[ ] ^
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:16: error: package io.flutter.plugin.common.MethodChannel does not exist
[ +3 ms] import io.flutter.plugin.common.MethodChannel.Result;
[ ] ^
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:17: error: package io.flutter.plugin.common.PluginRegistry does not exist
[ ] import io.flutter.plugin.common.PluginRegistry.Registrar;
[ ] ^
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:22: error: cannot find symbol
[ ] public class PackageInfoPlugin implements MethodCallHandler, FlutterPlugin {
[ ] ^
[ ] symbol: class MethodCallHandler
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:22: error: cannot find symbol
[ +9 ms] public class PackageInfoPlugin implements MethodCallHandler, FlutterPlugin {
[ ] ^
[ +2 ms] symbol: class FlutterPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:24: error: cannot find symbol
[ ] private MethodChannel methodChannel;
[ ] ^
[ +1 ms] symbol: class MethodChannel
[ ] location: class PackageInfoPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:27: error: cannot find symbol
[ ] public static void registerWith(Registrar registrar) {
[ +4 ms] ^
[ ] symbol: class Registrar
[ ] location: class PackageInfoPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:33: error: cannot find symbol
[ ] public void onAttachedToEngine(FlutterPluginBinding binding) {
[ ] ^
[ ] symbol: class FlutterPluginBinding
[ ] location: class PackageInfoPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:37: error: cannot find symbol
[ ] private void onAttachedToEngine(Context applicationContext, BinaryMessenger messenger) {
[ ] ^
[ ] symbol: class BinaryMessenger
[ ] location: class PackageInfoPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:44: error: cannot find symbol
[ ] public void onDetachedFromEngine(FlutterPluginBinding binding) {
[ +4 ms] ^
[ ] symbol: class FlutterPluginBinding
[ ] location: class PackageInfoPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:51: error: cannot find symbol
[ ] public void onMethodCall(MethodCall call, Result result) {
[ ] ^
[ ] symbol: class MethodCall
[ ] location: class PackageInfoPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:51: error: cannot find symbol
[ ] public void onMethodCall(MethodCall call, Result result) {
[ ] ^
[ ] symbol: class Result
[ ] location: class PackageInfoPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:32: error: method does not override or implement a method from a supertype
[ +4 ms] @Override
[ ] ^
[ +3 ms]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:39: error: cannot find symbol
[ +4 ms] methodChannel = new MethodChannel(messenger, "dev.fluttercommunity.plus/package_info");
[ ] ^
[ ] symbol: class MethodChannel
[ ] location: class PackageInfoPlugin
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:43: error: method does not override or implement a method from a supertype
[ ] @Override
[ ] ^
[ ]
/home/taha/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.3/android/src/main/java/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.ja
va:50: error: method does not override or implement a method from a supertype
[ ] @Override
[ +4 ms] ^
[ ] 20 errors
[ ] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':package_info_plus: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 8s
[ +370 ms] Running Gradle task 'assembleProfile'... (completed in 68.8s)
[ +8 ms] Exception: Gradle task assembleProfile failed with exit code 1
[ +4 ms] "flutter run" took 69,998ms.
[ +18 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
flutter/flutter#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:671:9)
<asynchronous suspension>
flutter/flutter#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1126:27)
<asynchronous suspension>
flutter/flutter#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
flutter/flutter#4 CommandRunner.runCommand (package:args/command_runner.dart:196:13)
<asynchronous suspension>
flutter/flutter#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
<asynchronous suspension>
flutter/flutter#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
flutter/flutter#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
<asynchronous suspension>
flutter/flutter#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
flutter/flutter#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
flutter/flutter#10 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
[ +223 ms] ensureAnalyticsSent: 217ms
[ +4 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ +1 ms] exiting with code 1
flutter doctor -v[✓] Flutter (Channel master, 2.3.0-17.0.pre.414, on Pop!_OS 21.04 5.11.0-7614-generic, locale en_US.UTF-8)
• Flutter version 2.3.0-17.0.pre.414 at /home/taha/Code/flutter_master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 757c3add14 (9 hours ago), 2021-06-20 22:29:02 -0400
• Engine revision 9520bb15b3
• Dart version 2.14.0 (build 2.14.0-228.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /home/taha/Code/SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /home/taha/Code/SDK
• Java binary at: /home/taha/Code/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• Ubuntu clang version 12.0.0-1ubuntu1
• cmake version 3.18.4
• ninja version 1.8.2
• pkg-config version 0.29.2
[✓] Android Studio (version 4.2)
• Android Studio at /home/taha/Code/android-studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)
[✓] VS Code (version 1.56.2)
• VS Code at /usr/share/code
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (3 available)
• Redmi K20 Pro (mobile) • def0ad20 • android-arm64 • Android 10 (API 29)
• Linux (desktop) • linux • linux-x64 • Pop!_OS 21.04 5.11.0-7614-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.114
• No issues found! |
cc @blasten for thoughts on a better workflow for local engine builds. We have a workaround right now so it should not be a blocker. |
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/flutter.gradle#L371-L374 seems to be failing in this case. @mraleph this is a bug in the Flutter plugin. |
I am having the same issue, and can confirm this workaround #899 (comment) solves my problem Btw, in case anyone finds the error "Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.", please put that code at the beginning of subprojects section, not the end. |
In light of #1072, I'm going to close this in favor of flutter/flutter#104667. Thanks everyone for helping each other debug and work around this! |
(Note: assuming that #525 is landed. Otherwise you first need to apply that on top)
/cc @blasten
The text was updated successfully, but these errors were encountered: