i'm actually trying to run my app but i'm stucked with that error :
Running "flutter pub get" in riverpod_stacked_app...
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
../../.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart:235:37: Error: No named parameter with the name 'shadowThemeOnly'.
final theme = Theme.of(context, shadowThemeOnly: true);
^^^^^^^^^^^^^^^
../../development/flutter/packages/flutter/lib/src/material/theme.dart:119:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {
^^
../../.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart:431:43: Error: No named parameter with the name 'shadowThemeOnly'.
theme: Theme.of(key.currentContext, shadowThemeOnly: true),
^^^^^^^^^^^^^^^
../../development/flutter/packages/flutter/lib/src/material/theme.dart:119:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {
^^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/Alex/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 900
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/Alex/development/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 19s
Exception: Gradle task assembleDebug failed with exit code 1
I don't understand why it can't build. I don't see the link between those 2 errors :
get_navigation
something with the theme from material.dart
And my actual motivation to use riverpod, stacked_services and firebase.
Here is the result of flutter doctor -v :
[✓] Flutter (Channel master, 1.24.0-8.0.pre.98, on Mac OS X 10.15.7 19H2 darwin-x64, locale fr-FR)
• Flutter version 1.24.0-8.0.pre.98 at /Users/Alex/development/flutter
• Framework revision ef4ec09a06 (6 hours ago), 2020-11-05 08:02:13 -0800
• Engine revision bf259226b2
• Dart version 2.12.0 (build 2.12.0-21.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/Alex/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• 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 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
! Doctor found issues in 1 category.
And here is my dependencies in pubspeck.yaml
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
stacked_services:
auto_route: 0.6.9
hooks_riverpod: 0.12.1
flutter_hooks:
firebase_core: 0.5.1
firebase_auth: 0.18.2
dev_dependencies:
flutter_test:
sdk: flutter
build_runner:
auto_route_generator:
Any ideas ? I've trie to clean up my dependencies and reinstall. Also i start a blank project with flutter counter app and it runs properly.
I also had this problem today after upgrading Flutter.
I was only able to solve it after I deleted that method parameter from the file that triggered the error. You'll have to delete it in two places.
Search in .pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart for
Theme.of(key.currentContext, shadowThemeOnly: true)
As replace it with
Theme.of(key.currentContext)
This is probably cause by the stacked_services dependency that uses the get: ^3.15.0 dependency
Later edit: this is actually not the best solution, because somebody cloning your repo will not be able to compile the project unless they also to this change
So it's better to upgrade the dependency that causes this error, or replace it with another one; but only after you ran flutter upgrade, or try changing the channel
this is already fixed by getx in 16.1. Pub upgrade will do it
https://github.com/jonataslaw/getx/issues/762
you need to remove only
ThemeData theme = Theme.of(key.currentContext, shadowThemeOnly: false);
if (theme != null) {
bottomSheet = new Theme(data: theme, child: bottomSheet);
}
return bottomSheet;
form your .pubcach folder.
Related
I have an problem building hello world flutter project for arm64 (apple m1 pro silicon) macos platform:
$ flutter build macos
Running "flutter pub get" in flutter_application_1... 234ms
💪 Building with sound null safety 💪
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-000C09201A06801E }
{ platform:macOS, arch:x86_64, id:00006000-000C09201A06801E }
Snapshot not compatible with the current VM configuration: the snapshot requires 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers no-dedup_instructions no-asserts use_field_guards use_osr no-branch_coverage x64-sysv no-compressed-pointers no-null-safety' but the VM has 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers no-dedup_instructions no-asserts use_field_guards use_osr no-branch_coverage arm64-sysv no-compressed-pointers no-null-safety'
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
Building macOS application...
Build process failed
Unfortunately I'm not an expert on flutter and flutter build tools, but it seems that flutter builds x86_64 binary and tries to run it on aarch64 platform for some reason. How can I make flutter to build aarch64 version of app?
Template project built with command:
flutter create --template app --platforms macos hello_world
Tools version info:
$ flutter --version
Flutter 3.0.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 85684f9300 (3 months ago) • 2022-06-30 13:22:47 -0700
Engine • revision 6ba2af10bb
Tools • Dart 2.17.5 • DevTools 2.12.2
$ sw_vers
ProductName: macOS
ProductVersion: 12.1
BuildVersion: 21C52
$ xcodebuild -version
Xcode 13.0
Build version 13A233
The main issue was with the way I've installed flutter: nixpkgs. It tries to find tools in wrong folder. After modifying patches https://github.com/NixOS/nixpkgs/pull/196133 for macos everything works fine.
Iam using Mac and upgraded to Android studio "Bumblebee", only in Mac when I try to do: Build -> Flutter -> Build iOS it shows this warning:
Warning: CocoaPods not installed. Skipping pod install. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. CocoaPods not installed or not in valid state. Process finished with exit code 1
But I did already this
gem install cocoapods Successfully installed cocoapods-1.11.2 Parsing documentation for cocoapods-1.11.2 Done installing documentation for cocoapods after 1 seconds 1 gem installed
When I do sudo gem install cocoapods I got:
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.
I did Invalidate Caches and pod install also, but it still shows same warning.
Flutter doctor
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.0.1 20B29 darwin-x64, locale en-GB)
• Flutter version 2.8.1 at /Users/test/Downloads/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/test/Library/Android/sdk
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[!] Xcode - develop for iOS and macOS (Xcode 12.5.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
! Flutter recommends a minimum Xcode version of 13.0.0.
Download the latest version or update via the Mac App Store.
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.1)
• Android Studio at /Users/test/Desktop/Android Studio.app/Contents
• 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.11+0-b60-7590822)
How to fix it?
Regards
close android studio
open terminal -> run open /Applications/Android\ Studio.app
try again ...
problem comes with new android studio version bumblebee
android studio started from macs dock is not able to reach the environment variables when its started from mac os dock
UPDATE:
run chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv
now it works from dock
Just run this at terminal: run chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv
The issue appears to be Cocopods not being installed with Big Sur or above. I found upgrading Ruby to a newer version and then installing Cocopods helped my coworker. Please follow the steps in the solution for installing Cocopods: Unable to install cocoa pods
It's now fixed with the latest patch on BumbleBee. Check this blog post.
when I run flutter i got these messages.
Launching lib\main.dart on SM G930S in debug mode...
Running Gradle task 'assembleDebug'...
Plugin project :firebase_core_web not found. Please update settings.gradle.
Plugin project :location_web not found. Please update settings.gradle.
Plugin project :firebase_auth_web not found. Please update settings.gradle.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> File 'com.android.builder.files.ZipCentralDirectory#116a0403' was deleted, but previous version not found in cache
* 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 26s
Exception: Gradle task assembleDebug failed with exit code 1
my pubspect.yaml
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# a b c d e f g h i j k l m n o p q r s t u v w x y z
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
animated_floatactionbuttons: ^0.1.0
awesome_dialog: ^1.1.3
awsome_video_player: ^1.0.8+1
badges: ^1.1.1
cupertino_icons: ^0.1.3
carousel_slider: ^2.2.1
cached_network_image: ^2.2.0+1
cached_video_player: ^1.0.3
email_validator: ^1.0.5
firebase_auth: ^0.16.1
flutter_bloc: ^6.0.1
flutter_money_formatter: ^0.8.2
flutter_gifimage: ^1.0.0
flutter_speed_dial: ^1.2.5
flutter_styled_toast: ^1.3.0
flutter_swiper: ^1.1.6
flutter_svg: ^0.17.0
fluttertoast: ^7.0.2
flick_video_player: ^0.1.1
get: ^3.4.6
getwidget: ^1.1.3
geolocator: ^5.3.2+2
google_nav_bar: ^2.2.0
google_maps_flutter: ^0.5.30
http: ^0.12.2
image_stack: ^1.1.0
image_picker: ^0.5.4+3
path_provider: ^1.6.11
path: ^1.6.4
line_icons: ^0.2.0
location: ^3.0.0
logger: ^0.9.2
provider: ^4.3.2+1
url_launcher: ^5.5.0
shared_preferences: ^0.5.8
smooth_star_rating: ^1.1.1
regexpattern: ^0.2.3
video_player: ^0.10.12
video_player_controls: ^2.1.6
dev_dependencies:
flutter_test:
sdk: flutter
Flutter Doctor report
[√] Flutter (Channel unknown, v1.17.5, on Microsoft Windows [Version 10.0.18363.1016], locale ko-KR)
• Flutter version 1.17.5 at C:\src\flutter
• Framework revision 8af6b2f038 (8 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\Silenmus\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 48.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.47.3)
• VS Code at C:\Users\Silenmus\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.13.2
[√] Connected device (2 available)
• SM G930S • ce0416040ac8423d04 • android-arm64 • Android 8.0.0 (API 26)
• sdk gphone x86 • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
I tried these to solve this problem
made new project and all copy of my project packages and run it
=> it works == I think it's not packages dependency problem
run AVD same error occurs
Changed image_picker version
=> ^0.5.4+3 works
=> over ^0.6.0 doesn't
I have no idea what's wrong with me or code or package or flutter 😫
# animated_floatactionbuttons: ^0.1.0
# awsome_video_player: ^1.0.8+1
# cached_video_player: ^1.0.3
# flutter_bloc: ^6.0.1
# regexpattern: ^0.2.3
# flick_video_player: ^0.1.1
i remove unused packages and it works
if someone who like me ,
remove package one by one it could save your debugging time. 😉
I installed flutter by official docs. When I did flutter doctor -v I don't get information with :
IOS toolchain as my other(old) mac book.
[✓] iOS toolchain - develop for iOS devices (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B500
• ios-deploy 1.9.4
• CocoaPods version 1.8.3
Instead this I get:
> [✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
> • Xcode at /Applications/Xcode.app/Contents/Developer
> • Xcode 11.2.1, Build version 11B500
> • CocoaPods version 1.8.4
and flutter doesn't see ios-deploy. Which I installed as well.
ios-deploy --version
1.10.0-beta.3
And as result on my new mac book my project doen't work. I cloned the same git branch on my new macbook and get error after run "flutter build ios --release --no-codesign":
8 warnings generated.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
ld: targeted OS version does not support use of thread local variables in __ZZN9GMSx_absl18container_internal10RandomSeedEvE7counter for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
#Pro You was right, this is not flutter issue.
Answear:
The issue fixed by changing the Deployment Target from 8.0 to 9.0 in Xcode
I get a build error using flutter version 1.2.2 and map_view version 0.0.14.
I tried to use this code in build.gradle
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-4'
I followed all the steps here https://pub.dartlang.org/packages/map_view#-readme-tab-
I have an api-key but get the following build error
Finished with error: Please review your Gradle project setup in the
android/ folder.
* Error running Gradle: ProcessException: Process "C:\Users\Almoit PC\Desktop\MyApp\Map\flutter_app2\android\gradlew.bat" exited
abnormally:
Configure project :map_view
WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.2.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
FAILURE: Build failed with an exception.
What went wrong: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.2.51 and higher. Project 'android' is using
version 1.1.2-4.
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 10s Command: C:\Users\Almoit
PC\Desktop\MyApp\Map\flutter_app2\android\gradlew.bat app:properties
flutter doctor -v
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17763.437], locale en-AI)
• Flutter version 1.2.1 at C:\flutter
• Framework revision 8661d8aecd (10 weeks ago), 2019-02-14 19:19:53 -0800
• Engine revision 3757390fa4
• Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = C:\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[√] Android Studio (version 3.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 33.4.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[√] Connected device (1 available)
• SPH L520 • 2d81b4cf • android-arm • Android 4.4.2 (API 19)
• No issues found!