I have tried to build app 'flutter_html: ^2.1.5" but I unable to build and getting below error in log.
The current Flutter SDK version is 1.27.0-2.0.pre.1.
Because flutter_app depends on flutter_html >=2.1.0 which requires Flutter SDK version >=2.2.0, version solving failed.
pub get failed (1; Because flutter_app depends on flutter_html >=2.1.0 which requires Flutter SDK version >=2.2.0, version solving failed.)
can you suggest the way to clear this issue?
I have upgraded flutter version and migrated and having different issue.
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:checkDebugManifest' (type 'CheckManifest').
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.tasks.CheckManifest' property 'manifest' has #Input annotation used on property of type 'File'.
Reason: A property of type 'File' annotated with #Input cannot determine how to interpret the file.
Possible solutions:
1. Annotate with #InputFile for regular files.
2. Annotate with #InputDirectory for directories.
3. If you want to track the path, return File.absolutePath as a String and keep #Input.
Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.
* 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 11s
Exception: Gradle task assembleDebug failed with exit code 1
You need to upgrade your flutter SDK. Write flutter upgrade in terminal.
Or use an older version of flutter_html.
Related
I started working with Flutter and Dart lately, and I'm building a project using the tflite package. But when I want to build the app, even the demo app when just adding the tflite package to my dependencies in pubspec.yaml, to my phone (Xiaomi redmi note 10, android 12) it shows this error:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\User\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\tflite-1.1.2\android\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':tflite'.
> No signature of method: build_9lbq7rfhl5cpix99148s3txh6.android() is applicable for argument types: (build_9lbq7rfhl5cpix99148s3txh6$_run_closure2) values: [build_9lbq7rfhl5cpix99148s3txh6$_run_closure2#77b9e791]
* 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 5s
Exception: Gradle task assembleDebug failed with exit code 1
Also, when I firstly clicked 'pub get' after depending on tflite, it showed this error:
The plugin `tflite` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
but since I am not the package author, i didn't thought much of it.
I've seen that the tflite package was lastly updated 18 months ago.
So, is there an updated version of the package? Or, is there an alternative for running the google teachable machine?
That is the last known edit to the package. If there are issues that make it unusable now, I'd suggest leaving an issue on their GitHub page so that they can address it moving forward. Unfortunately, you might have to find an alternative to using that package, or edit the package locally yourself to get rid of any dependency issues.
Judging from the volume of issues on this package raised on github (https://github.com/shaqian/flutter_tflite), I don't think it's being maintained at all anymore.
I am trying to build an apk of my flutter app, but when I run this command
flutter build apk
I encounter the following error;
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':clipboard_manager:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/home/username/.gradle/caches/transforms-2/files-2.1/a528b13ac93e64cafa3d0480e2c93207/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/home/username/.gradle/caches/transforms-2/files-2.1/a528b13ac93e64cafa3d0480e2c93207/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
* 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 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 10.1s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the
incompatibility.
Building plugin clipboard_manager...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 741ms
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'clipboard_manager'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* 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 0s
The plugin clipboard_manager could not be built due to the issue above.
I am getting the flutter pub outdated --mode=null-safety
Package Name Current Upgradable Resolvable Latest
direct dependencies:
clipboard_manager ✗0.0.4 ✗0.0.4 ✗0.0.4 ✗0.0.4
cupertino_icons ✗0.1.3 ✗0.1.3 ✓1.0.3 ✓1.0.3
dio ✗3.0.10 ✗3.0.10 ✓4.0.0 ✓4.0.0
flutter_circular_chart ✗0.1.0 ✗0.1.0 ✗0.1.0 ✗0.1.0
flutter_secure_storage ✗3.3.5 ✗3.3.5 ✓4.2.0 ✓4.2.0
flutter_svg ✗0.19.3 ✗0.19.3 ✓0.22.0 ✓0.22.0
http ✗0.12.2 ✗0.12.2 ✓0.13.3 ✓0.13.3
image_picker ✗0.6.5+3 ✗0.6.5+3 ✓0.8.0+3 ✓0.8.0+3
logger ✗0.9.4 ✗0.9.4 ✓1.0.0 ✓1.0.0
provider ✗4.3.3 ✗4.3.3 ✓5.0.0 ✓5.0.0
8 dependencies are constrained to versions that are older than a resolvable version.
To update these dependencies, edit pubspec.yaml, or run `flutter pub upgrade --null-safety`.
I have searched for it, and they told to change the flutter.sdk, to home.username/Android/Sdk I did this, but after running the buiuld command I got home/lechat/snap/flutter/common/flutter in flutter.sdk in local.properties.
I do not know what the problem actually is. Kindly halp me with this problem. If you any other information I am ready to share it.
I have also followed this question, related problem
but still getting the same error.
Check this similar question there are multiple answers and all of them seem to get the work done, only one of them uses clipboard_manager though.
My flutter app doesn't even have webview_flutter plugin and it's showing error for that. Gradle build failure. First it told me to set minSDkVersion to 19. I did that but still error. I had the same app but different project running before with exact same code and plugins. I don't understand what's going on. Please help.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\thumbnails-
1.0.1\android\src\main\java\com\asapjay\thumbnails\ThumbnailsPlugin.java uses or overrides a
deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\flutter\.pub-cache\hosted\pub.dartlang.org\webview_flutter-
2.0.6\android\src\main\java\io\flutter\plugins\webviewflutter\InputAwareWebView.java:31: error:
cannot find symbol
private ThreadedInputConnectionProxyAdapterView proxyAdapterView;
^
symbol: class ThreadedInputConnectionProxyAdapterView
location: class InputAwareWebView
C:\flutter\.pub-cache\hosted\pub.dartlang.org\webview_flutter-
2.0.6\android\src\main\java\io\flutter\plugins\webviewflutter\InputAwareWebView.java:112: error:
cannot find symbol
new ThreadedInputConnectionProxyAdapterView(
^
symbol: class ThreadedInputConnectionProxyAdapterView
location: class InputAwareWebView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':webview_flutter: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 44s
Exception: Gradle task assembleDebug failed with exit code 1
ThreadedInputConnectionProxyAdapterView has wrong extension .jav
You can just change it to .java by hand as a temporary fix.
or
I temporarily downgraded webview_flutter back to 2.0.4. (after downgrading webview_flutter if this solution not working then you need to check your pubsepc.lock file for webview_flutter, because some other dependencies may extend webview_flutter so this package will visible in pubsepc.lock file, then you just need downgrade webview_flutter from this file also)
Enjoy!
This happen because of the webview_flutter package version issue. I have downgrade the version and it worked. Go to the pubspec.yaml and downgrade the version to 2.0.14
The flutter project ran well on my android device before i ran flutter grade command. And then the project just cant run anyway without any code change. Here is the error message:
Launching lib/main.dart on RMX1971 in debug mode...
Running Gradle task 'assembleDebug'...
../../env/flutter/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.4/lib/src/smart_refresher.dart:434:9: Error: No named parameter with the name 'keyboardDismissBehavior'.
keyboardDismissBehavior:
^^^^^^^^^^^^^^^^^^^^^^^
../../env/flutter/packages/flutter/lib/src/widgets/scroll_view.dart:588:9: Context: Found this candidate, but the arguments don't match.
const CustomScrollView({
^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
Where:
Script '/Users/lgk/env/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 907
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/lgk/env/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 14s
Exception: Gradle task assembleDebug failed with exit code 1
This is actually a compatibility issue between pull_to_refresh plugin and the current version of Flutter during this time. There are some bugs related to this and most of the solutions were found on the thread:
https://github.com/peng8350/flutter_pulltorefresh/issues/427
https://github.com/peng8350/flutter_pulltorefresh/issues/424
To summarized the solution from this thread:
How to solve Error: No named parameter with the name 'keyboardDismissBehavior' ?
to solve Error: No named parameter
with the name 'keyboardDismissBehavior' This error is caused due to
pull_to_refresh plugin that you are using in your flutter app is not
compatible with the current version of flutter. The solution is just
downgraded your plugin version.
Error: No named parameter with the name 'keyboardDismissBehavior
to solve Error: No named parameter with
the name 'keyboardDismissBehavior' This error is caused due to
pull_to_refresh plugin that you are using in your flutter app is not
compatible with the current version of flutter. The solution is just
downgraded your plugin version.
Solution 1
This error is cause due to pull_to_refresh plugin that you are using
in your flutter app that is not compatible with the current version of
flutter. The solution is just to downgrade your plugin version. Just
Follow below step to solve this error.
Edit file pubspec.yaml
Change This Line pull_to_refresh ^1.6.4 or pull_to_refresh ^1.6.3
Replace with pull_to_refresh 1.6.3
run flutter clean
flutter run
Solution 2
pull_to_refresh plugin is not compatible with the current version of
flutter.
I can successfully build and run a fresh new flutter project. But when I add both image_cropper: ^1.0.0 and contacts_service: ^0.2.4 packages to pubspec.yaml and run flutter packages get, I cannot build the project anymore, and get this build error:
D8: Program type already present: android.support.v4.app.INotificationSideChannel
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\2.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\3.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\4.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\5.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\6.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\7.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\8.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\9.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\10.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\11.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\12.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\13.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\14.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\15.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\16.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\17.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\18.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\19.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\20.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\21.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\22.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\23.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\24.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\25.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\26.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\27.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\28.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\29.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\30.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\31.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\32.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\33.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\34.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\35.jar, E:\Projects\flutter\hello\build\app\intermediates\transforms\dexBuilder\debug\36.jar
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.INotificationSideChannel
* 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 19s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https:///CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1
I do not understand this error very well, but it seems that there is a naming conflict between these two packages (because of duplicate_classes in the error text). Is there any workaround for this?
Note that this error does not happen with any other pair of packages for me.
In build.gradle defaultConfig add multiDexEnabled true
This was an Android X compatibility issue. I could get it fixed by following the steps mentioned here, but in summary:
First make sure that compileSdkVersion is at least 28 in app/build.gradle. This property controls the version of the Android SDK that Gradle uses to build your APK. It doesn’t affect the minimum SDK version that your app can run on.
Right click on android directory of flutter project and open it using this menu: Flutter > Open android module in android studio
In the newly opened project, from menus select Refactor > Migrate to AdnroidX
Close the project and open your flutter project again.