appflowy-editor
appflowy-editor copied to clipboard
[Bug] Cannot Run Project
Bug Description
I cannot run a project after adding this package! my console log:
Launching lib\main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... /C:/Users/**/AppData/Local/Pub/Cache/hosted/pub.dev/rich_clipboard_windows-1.0.3/lib/src/win32_clipboard.dart:91:31: Error: The argument type 'Pointer<NativeType>' can't be assigned to the parameter type 'int'.
- 'Pointer' is from 'dart:ffi'.
- 'NativeType' is from 'dart:ffi'. final rawPtr = GlobalLock(handle); ^ /C:/Users/**/AppData/Local/Pub/Cache/hosted/pub.dev/rich_clipboard_windows-1.0.3/lib/src/win32_clipboard.dart:93:20: Error: The argument type 'Pointer<NativeType>' can't be assigned to the parameter type 'int'.
- 'Pointer' is from 'dart:ffi'.
- 'NativeType' is from 'dart:ffi'. GlobalUnlock(handle); ^ /C:/Users/**/AppData/Local/Pub/Cache/hosted/pub.dev/rich_clipboard_windows-1.0.3/lib/src/win32_clipboard.dart:107:18: Error: The argument type 'Pointer<NativeType>' can't be assigned to the parameter type 'int'.
- 'Pointer' is from 'dart:ffi'.
- 'NativeType' is from 'dart:ffi'. GlobalUnlock(handle); ^ /C:/Users/**/AppData/Local/Pub/Cache/hosted/pub.dev/rich_clipboard_windows-1.0.3/lib/src/win32_clipboard.dart:177:40: Error: The getter 'address' isn't defined for the class 'int'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'address'. SetClipboardData(format, memHandle.address); ^^^^^^^ Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.console
my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.19.3, on Microsoft Windows [Version 10.0.22621.3155], locale en-US) [✓] Windows Version (Installed version of Windows is version 10 or higher) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Chrome - develop for the web [✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.0.2) [!] Android Studio (version 2022.1) ✗ Unable to determine bundled Java version. [✓] Android Studio (version 2023.1) [✓] VS Code (version 1.87.1) [✓] Connected device (4 available) [✓] Network resources
! Doctor found issues in 1 category.console
How to Reproduce
just add the package and try to run!
Expected Behavior
run like a human!
Operating System
Android 11
AppFlowy Editor Version(s)
2.3.3
Screenshots
No response
Additional Context
after that, I will create a new project and add this package yet I cannot run the project. ext.kotlin_version = '1.8.0' console log: Launching lib\main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'...
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-
Where: Build file 'C:\Users\Abolfazl\AppData\Local\Pub\Cache\hosted\pub.dev\rich_clipboard_android-1.0.1\android\build.gradle' line: 12
-
What went wrong: A problem occurred evaluating project ':rich_clipboard_android'.
Could not get unknown property 'kotlin_version' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
- 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. ==============================================================================
2: Task failed with an exception.
- What went wrong: A problem occurred configuring project ':rich_clipboard_android'.
Failed to notify project evaluation listener. Could not get unknown property 'android' for project ':rich_clipboard_android' of type org.gradle.api.Project. Could not get unknown property 'android' for project ':rich_clipboard_android' 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 1s Error: Gradle task assembleDebug failed with exit code 1
same
For the second error "missing kotlin version", add kotlin version definition to your build.gradle, like the commit here.
After upgrade fluttet to 3.19 (also new created projects, maybe), some build configs in gradle are marked as deprecated, and this error will occur if you update the config following official migrate guide.
My project runs well after the commit above.