flutter-quill
flutter-quill copied to clipboard
Strange behavior when compiling on Android
Is there an existing issue for this?
- [X] I have searched the existing issues
Flutter Quill version
9.1.1
Steps to reproduce
flutter create test_quill flutter pub add flutter_quill flutter_quill_extensions flutter run
Actual results
First it compiles. It produces a bunch of errors and starts on the phone, but in the end it just hangs on a black screen and hot reload doesn’t help. If you remove these two packages then this error will not occur. It doesn't work in either a real or test project.
Console output
Flutter version
Same problem
https://github.com/dart-lang/build/issues/3622 https://github.com/flutter/flutter/issues/139925
Code sample
[Code] main.dart
// [main.dart]
import 'package:flutter/material.dart';
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_quill_extensions/embeds/widgets/image.dart';
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
late final QuillController _controller;
final _focusNode = FocusNode();
final _scrollController = ScrollController();
@override
void initState() {
super.initState();
const content = [
{
"insert": "Hello World!\n",
}
];
_controller = QuillController(
document: Document.fromJson(content),
selection: const TextSelection.collapsed(offset: 0),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: QuillEditor(
configurations: QuillEditorConfigurations(
controller: _controller,
scrollable: false,
readOnly: false,
embedBuilders: (isWeb()
? FlutterQuillEmbeds.editorWebBuilders()
: FlutterQuillEmbeds.editorBuilders(
imageEmbedConfigurations:
QuillEditorImageEmbedConfigurations(
imageErrorWidgetBuilder:
(context, error, stackTrace) {
return Text(
'Error while loading an image: ${error.toString()}',
);
},
imageProviderBuilder: (context, url) {
if (isAndroid(supportWeb: false) ||
isIOS(supportWeb: false) ||
isWeb()) {
if (isHttpBasedUrl(url)) {
return NetworkImage(url);
}
}
return getImageProviderByImageSource(
url,
imageProviderBuilder: null,
context: context,
assetsPrefix:
QuillSharedExtensionsConfigurations.get(
context: context)
.assetsPrefix,
);
},
),
))),
focusNode: _focusNode,
scrollController: _scrollController)),
);
}
}
Logs
Full text console output
Launching lib\main.dart on M2103K19PG in debug mode...
���⥬� �� 㤠���� ���� 㪠����� ����.
���⥬� �� 㤠���� ���� 㪠����� ����.
�� 㤠���� ���� 㪠����� 䠩�.
�� 㤠���� ���� 㪠����� 䠩�.
Cannot operate on packages inside the cache.
Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill.
Error: Couldn't resolve the package 'build_tool' in 'package:build_tool/build_tool.dart'.
bin/build_tool_runner.dart:1:8: Error: Not found: 'package:build_tool/build_tool.dart'
import 'package:build_tool/build_tool.dart' as build_tool;
^
bin/build_tool_runner.dart:3:15: Error: Method not found: 'runMain'.
build_tool.runMain(args);
^^^^^^^
Could not find a command named "bin\build_tool_runner.dill".
Usage: dart <command|dart-file> [arguments]
Global options:
-v, --verbose Show additional command output.
--version Print the Dart SDK version.
--enable-analytics Enable analytics.
--disable-analytics Disable analytics.
--suppress-analytics Disallow analytics for this `dart *` run without changing the analytics configuration.
-h, --help Print this usage information.
Available commands:
analyze Analyze Dart code in a directory.
compile Compile Dart to various formats.
create Create a new Dart project.
devtools Open DevTools (optionally connecting to an existing application).
doc Generate API documentation for Dart projects.
fix Apply automated fixes to Dart source code.
format Idiomatically format Dart source code.
info Show diagnostic information about the installed tooling.
pub Work with packages.
run Run a Dart program.
test Run tests for a project.
Run "dart help <command>" for more information about a command.
See https://dart.dev/tools/dart-tool for detailed documentation.
���⥬� �� 㤠���� ���� 㪠����� ����.
���⥬� �� 㤠���� ���� 㪠����� ����.
�� 㤠���� ���� 㪠����� 䠩�.
�� 㤠���� ���� 㪠����� 䠩�.
Cannot operate on packages inside the cache.
Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill.
Error: Couldn't resolve the package 'build_tool' in 'package:build_tool/build_tool.dart'.
bin/build_tool_runner.dart:1:8: Error: Not found: 'package:build_tool/build_tool.dart'
import 'package:build_tool/build_tool.dart' as build_tool;
^
bin/build_tool_runner.dart:3:15: Error: Method not found: 'runMain'.
build_tool.runMain(args);
^^^^^^^
Could not find a command named "bin\build_tool_runner.dill".
Usage: dart <command|dart-file> [arguments]
Global options:
-v, --verbose Show additional command output.
--version Print the Dart SDK version.
--enable-analytics Enable analytics.
--disable-analytics Disable analytics.
--suppress-analytics Disallow analytics for this `dart *` run without changing the analytics configuration.
-h, --help Print this usage information.
Available commands:
analyze Analyze Dart code in a directory.
compile Compile Dart to various formats.
create Create a new Dart project.
devtools Open DevTools (optionally connecting to an existing application).
doc Generate API documentation for Dart projects.
fix Apply automated fixes to Dart source code.
format Idiomatically format Dart source code.
info Show diagnostic information about the installed tooling.
pub Work with packages.
run Run a Dart program.
test Run tests for a project.
Run "dart help <command>" for more information about a command.
See https://dart.dev/tools/dart-tool for detailed documentation.
Running Gradle task 'assembleDebug'... 20,2s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Syncing files to device M2103K19PG... 234ms
The issue is not happening in the example, can you check your Android environment?
What exactly should I check there?
it is caused by super_clipboard, used in flutter_quill as dependancy because it used super_native_extensions which used irondash_engine_context, irondash_message_chann.
Solutions: Currently flutter clean and rebuild again.
Facing this same issue. Any solve yet?
Solutions: Currently flutter clean and rebuild again.
This didn't help either. I’ve already done this 5 times in a row and install different old versions
use dart pub cache repair commands to fix pub cache problems. Furthermore, If you try to downgrade to older versions make sure to remove the caret sign (^) from the start of the version numbers otherwise it will install the newest version. Then flutter clean and build again. Hope it will solve your problem.
+1, Neither flutter pub cache clean nor flutter clean can solve the problem
Still facing this in ^9.#.# versions, so I downgraded to last ^8.#.#.
make sure to remove the caret sign (^) from the start of the version numbers otherwise, it will install the newest version. i.e instead of ^8.#.# use only 8.#.#.
Can you create the issue on the super_clipboard plugin repository? It probably a issue from the plugin itself
Can you create the issue on the super_clipboard plugin repository? It probably a issue from the plugin itself
I think is not caused by other plugin. I run the example Repository (GitHub) and report:
Error: Couldn't resolve the package 'build_tool' in 'package:build_tool/build_tool.dart'. bin/build_tool_runner.dart:1:8: Error: Not found: 'package:build_tool/build_tool.dart' import 'package:build_tool/build_tool.dart' as build_tool; ^ bin/build_tool_runner.dart:3:15: Error: Method not found: 'runMain'. build_tool.runMain(args); ^^^^^^^ Could not find a command named "bin\build_tool_runner.dill".
Can you create the issue on the super_clipboard plugin repository? It probably a issue from the plugin itself
I think is not caused by other plugin. I run the example Repository (GitHub) and report:
Error: Couldn't resolve the package 'build_tool' in 'package:build_tool/build_tool.dart'. bin/build_tool_runner.dart:1:8: Error: Not found: 'package:build_tool/build_tool.dart' import 'package:build_tool/build_tool.dart' as build_tool; ^ bin/build_tool_runner.dart:3:15: Error: Method not found: 'runMain'. build_tool.runMain(args); ^^^^^^^ Could not find a command named "bin\build_tool_runner.dill".
The example itself uses the plugin
temporary solution:
Add ndkVersion in the build.gradle
https://developer.android.com/ndk
But this is the wrong way! These kinds of dependencies must be specified inside the library. Please fix
Same issue on android but its work fine on ios and web
in my case, i just downgraded to 8.x.x
Same problem here . Forced to downgrade to 8.6.4
We have two solutions, either we contact with the author of https://pub.dev/packages/super_clipboard
for a solution
Or we replace it with another clipboard plugin
that can:
- retrieve html content from the clipboard
- Up to date with flutter 3.16 and future versions
- Can get an image from clipboard or copy image to the clipboard using base 64
Also make sure to follow the instructions on the plugin README
Also make sure to follow the instructions on the plugin README
Maybe you can add the necessary line from the readmi inside the library? It seems to me that it is wrong that every user who uses flutter_quill should register an ndk for themselves.
Smth like this .
I also had this problem after increasing version, reason:
and after an explicit indication version of local ndk in the build.gragle it worked.
Also make sure to follow the instructions on the plugin README
Maybe you can add the necessary line from the readmi inside the library? It seems to me that it is wrong that every user who uses
flutter_quillshould register anndkfor themselves.Smth like this .
I also had this problem after increasing version, reason:
![]()
and after an explicit indication version of local
ndkin thebuild.gragleit worked.
This is a package, not a plugin. Besides, we can't change the minimum version because it will require the user to change it anyway
Please make sure to follow the instructions and install rust on Windows
I need to know which platform you are using
Can you try with 9.2.5? It doesn't contain any fix for the issue, but the new version of the super clipboard has more error messages, and we need it to debug the bug
Also make sure to follow the instructions on the plugin README
Maybe you can add the necessary line from the readmi inside the library? It seems to me that it is wrong that every user who uses
flutter_quillshould register anndkfor themselves.Smth like this .
I also had this problem after increasing version, reason:
![]()
and after an explicit indication version of local
ndkin thebuild.gragleit worked.
May I ask when you created your flutter project? Because all new flutter projects has ndk version by default
You can try out with 9.2.6
Is there an existing issue for this?
- [X] I have searched the existing issues
Flutter Quill version
9.1.1
Steps to reproduce
flutter create test_quill flutter pub add flutter_quill flutter_quill_extensions flutter run
Actual results
First it compiles. It produces a bunch of errors and starts on the phone, but in the end it just hangs on a black screen and hot reload doesn’t help. If you remove these two packages then this error will not occur. It doesn't work in either a real or test project.
Console output
![]()
Flutter version
Same problem
https://github.com/dart-lang/build/issues/3622 https://github.com/flutter/flutter/issues/139925
Code sample
[Code] main.dart
// [main.dart] import 'package:flutter/material.dart'; import 'package:flutter_quill/extensions.dart'; import 'package:flutter_quill/flutter_quill.dart'; import 'package:flutter_quill_extensions/embeds/widgets/image.dart'; import 'package:flutter_quill_extensions/flutter_quill_extensions.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: const MyHomePage(), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key}); @override State<MyHomePage> createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { late final QuillController _controller; final _focusNode = FocusNode(); final _scrollController = ScrollController(); @override void initState() { super.initState(); const content = [ { "insert": "Hello World!\n", } ]; _controller = QuillController( document: Document.fromJson(content), selection: const TextSelection.collapsed(offset: 0), ); } @override Widget build(BuildContext context) { return Scaffold( body: Center( child: QuillEditor( configurations: QuillEditorConfigurations( controller: _controller, scrollable: false, readOnly: false, embedBuilders: (isWeb() ? FlutterQuillEmbeds.editorWebBuilders() : FlutterQuillEmbeds.editorBuilders( imageEmbedConfigurations: QuillEditorImageEmbedConfigurations( imageErrorWidgetBuilder: (context, error, stackTrace) { return Text( 'Error while loading an image: ${error.toString()}', ); }, imageProviderBuilder: (context, url) { if (isAndroid(supportWeb: false) || isIOS(supportWeb: false) || isWeb()) { if (isHttpBasedUrl(url)) { return NetworkImage(url); } } return getImageProviderByImageSource( url, imageProviderBuilder: null, context: context, assetsPrefix: QuillSharedExtensionsConfigurations.get( context: context) .assetsPrefix, ); }, ), ))), focusNode: _focusNode, scrollController: _scrollController)), ); } }Logs
Full text console output
Launching lib\main.dart on M2103K19PG in debug mode... ���⥬� �� 㤠���� ���� 㪠����� ����. ���⥬� �� 㤠���� ���� 㪠����� ����. �� 㤠���� ���� 㪠����� 䠩�. �� 㤠���� ���� 㪠����� 䠩�. Cannot operate on packages inside the cache. Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill. Error: Couldn't resolve the package 'build_tool' in 'package:build_tool/build_tool.dart'. bin/build_tool_runner.dart:1:8: Error: Not found: 'package:build_tool/build_tool.dart' import 'package:build_tool/build_tool.dart' as build_tool; ^ bin/build_tool_runner.dart:3:15: Error: Method not found: 'runMain'. build_tool.runMain(args); ^^^^^^^ Could not find a command named "bin\build_tool_runner.dill". Usage: dart <command|dart-file> [arguments] Global options: -v, --verbose Show additional command output. --version Print the Dart SDK version. --enable-analytics Enable analytics. --disable-analytics Disable analytics. --suppress-analytics Disallow analytics for this `dart *` run without changing the analytics configuration. -h, --help Print this usage information. Available commands: analyze Analyze Dart code in a directory. compile Compile Dart to various formats. create Create a new Dart project. devtools Open DevTools (optionally connecting to an existing application). doc Generate API documentation for Dart projects. fix Apply automated fixes to Dart source code. format Idiomatically format Dart source code. info Show diagnostic information about the installed tooling. pub Work with packages. run Run a Dart program. test Run tests for a project. Run "dart help <command>" for more information about a command. See https://dart.dev/tools/dart-tool for detailed documentation. ���⥬� �� 㤠���� ���� 㪠����� ����. ���⥬� �� 㤠���� ���� 㪠����� ����. �� 㤠���� ���� 㪠����� 䠩�. �� 㤠���� ���� 㪠����� 䠩�. Cannot operate on packages inside the cache. Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill. Error: Couldn't resolve the package 'build_tool' in 'package:build_tool/build_tool.dart'. bin/build_tool_runner.dart:1:8: Error: Not found: 'package:build_tool/build_tool.dart' import 'package:build_tool/build_tool.dart' as build_tool; ^ bin/build_tool_runner.dart:3:15: Error: Method not found: 'runMain'. build_tool.runMain(args); ^^^^^^^ Could not find a command named "bin\build_tool_runner.dill". Usage: dart <command|dart-file> [arguments] Global options: -v, --verbose Show additional command output. --version Print the Dart SDK version. --enable-analytics Enable analytics. --disable-analytics Disable analytics. --suppress-analytics Disallow analytics for this `dart *` run without changing the analytics configuration. -h, --help Print this usage information. Available commands: analyze Analyze Dart code in a directory. compile Compile Dart to various formats. create Create a new Dart project. devtools Open DevTools (optionally connecting to an existing application). doc Generate API documentation for Dart projects. fix Apply automated fixes to Dart source code. format Idiomatically format Dart source code. info Show diagnostic information about the installed tooling. pub Work with packages. run Run a Dart program. test Run tests for a project. Run "dart help <command>" for more information about a command. See https://dart.dev/tools/dart-tool for detailed documentation. Running Gradle task 'assembleDebug'... 20,2s √ Built build\app\outputs\flutter-apk\app-debug.apk. Syncing files to device M2103K19PG... 234ms
The issue should be fixed in 9.2.6
Please try it out and tell me if it is not fixed
After using 9.2.6, irondash_engine_context can be built normally, but super_native_extensions will still fail to build, with the following error
The log of running flutter build apk -v is as follows
log.txt
Can you try installing https://visualstudio.microsoft.com/visual-cpp-build-tools/ ?
It seems that you have Rustup installed, which requires the build tools to work properly on Windows. Another alternative would be to uninstall Rustup, in which case the plugin will just use prebuilt binaries.
Can you try installing https://visualstudio.microsoft.com/visual-cpp-build-tools/ ?
It seems that you have Rustup installed, which requires the build tools to work properly on windows Another alternative would be to uninstall Rustup, in which case the plugin will just use prebuilt binaries.
Make sense.
Can you try installing https://visualstudio.microsoft.com/visual-cpp-build-tools/ ?
It seems that you have Rustup installed, which requires the build tools to work properly on windows Another alternative would be to uninstall Rustup, in which case the plugin will just use prebuilt binaries.
Thank you very much, I can build normally after uninstalling rust.
I'm closing this issue as fixed as @knopp fixed it to all the users of super_clipboard and flutter_quill
If anyone still facing it please let me know
To fix the error with "irondash_engine_context", I had to add the missing ndkVersion flutter.ndkVersion line after compileSdkVersion flutter.compileSdkVersion in android/app/build.gradle
To fix the error with "irondash_engine_context", I had to add the missing
ndkVersion flutter.ndkVersionline aftercompileSdkVersion flutter.compileSdkVersioninandroid/app/build.gradle
That should already be there for any new Flutter generated projects.