I started Android Studio and installed it nd check in cmd also by Flutter doctor it shows everything right. But when I run hello world program it shows many errors can anyone help me plz. below i pasted the codes
error:
The method 'MaterialApp' isn't defined for the type 'MyApp'. (undefined_method at [helloword] lib\MyApp.dart:9)
error: The method 'ThemeData' isn't defined for the type 'MyApp'. (undefined_method at [helloword] lib\MyApp.dart:12)
error: Undefined name 'Colors'. (undefined_identifier at [helloword] lib\MyApp.dart:13)
error: Undefined name 'Colors'. (undefined_identifier at [helloword] lib\MyApp.dart:14)
error: The method 'Scaffold' isn't defined for the type 'MyApp'. (undefined_method at [helloword] lib\MyApp.dart:16)
error: The method 'AppBar' isn't defined for the type 'MyApp'. (undefined_method at [helloword] lib\MyApp.dart:17)
error: Undefined name 'Colors'. (undefined_identifier at [helloword] lib\MyApp.dart:19)
error: Named parameters must be enclosed in curly braces ('{' and '}'). (named_parameter_outside_group at [helloword] lib\main.dart:4)
error: A function body must be provided. (missing_function_body at [helloword] lib\main.dart:4)
error: Default values aren't allowed in function typed parameters. (default_value_in_function_typed_parameter at [helloword] lib\main.dart:4)
error: A function body must be provided. (missing_function_body at [helloword] lib\main.dart:4)
error: The function 'MyApp' isn't defined. (undefined_function at [helloword] test\widget_test.dart:16)
info: Name non-constant identifiers using lowerCamelCase. (non_constant_identifier_names at [helloword] lib\main.dart:4)
info: Unused import: 'package:helloword/main.dart'. (unused_import at [helloword] test\widget_test.dart:11)
Make sure you have installed Android studio flutter plugin and Flutter sdk is set up in your path.
Follow the guide from flutter.dev
May be you are missing the material import.
make sure you have
import: package: flutter/material.dart
..also try running flutter packages get once again.
Hope it helps..
C:\Users\user>flutter doctor --verbose
[√] Flutter (Channel stable, v1.17.3, on Microsoft Windows [Version 10.0.18362.836], locale en-IN)
• Flutter version 1.17.3 at c:\src\flutter\flutter
• Framework revision b041144f83 (6 days ago), 2020-06-04 09:26:11 -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\user\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)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[!] Connected device
! No devices available
Related
I have been trying to install excel: ^1.1.5 version. But all I am getting this error.
Because excel >=1.0.4 <2.0.0-null-safety depends on xml ^4.1.0 which depends on convert ^2.1.0, excel >=1.0.4 <2.0.0-null-safety requires convert ^2.1.0.
And because `json_serializable` >=4.0.3 depends on build ^2.0.0 which depends on convert ^3.0.0, excel >=1.0.4 <2.0.0-null-safety is incompatible with `json_serializable` >=4.0.3.
And because invoiceninja 0.0.9 depends on `json_serializable` ^4.1.0 and no versions of `invoiceninja` match >0.0.9 <0.1.0, excel >=1.0.4 <2.0.0-null-safety is incompatible with `invoiceninja` ^0.0.9.
So, because `etf` depends on both `invoiceninja` ^0.0.9 and excel ^1.1.5, version solving failed.
pub get failed (1; So, because `etf` depends on both `invoiceninja` ^0.0.9 and excel ^1.1.5, version solving failed.)
exit code 1
'''Version'''
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 2.11.0-0.1.pre, on Microsoft Windows [Version 10.0.18363.418], locale en-US)
I've activated Dart non-nullable syntax experiment in my pubspec.yaml file:
name: tests
description: A new Flutter application.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.9.0-21.0.dev.flutter <3.0.0"
analyzer:
enable-experiment:
- non-nullable
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
So, now after running flutter pub get I'm trying to create a class using non-nullable syntax:
class Component_Decorator_A extends Component_Decorator {
Component_Decorator_A([Component? component]) : super(component);
#override
operation() {
component?.operation();
print('Component_Decorator_A.Operation()');
}
}
Quite surprisingly, syntax analyzer in Android Studio says:
This requires non-nullable language feature to be enabled. Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9.9 or higher, and running pub get.
Ok, I cannot set the minimum SDK version to exactly 2.9.0 as suggested, as far as each time I try to set environment: sdk: ">=2.9.0 <3.0.0" in my pubspec.yaml, the subsequent flutter pub get leads to the next version solving error that I was unable to resolve:
flutter pub get
Running "flutter pub get" in master000...
The current Dart SDK version is 2.9.0-21.0.dev.flutter-2e05e6c94a.
Because patterns_experiments_and_tests requires SDK version >=2.9.0 <3.0.0, version solving failed.
---- Log transcript ----
FINE: Pub 2.9.0-21.0.dev.flutter-2e05e6c94a
MSG : Resolving dependencies...
SLVR: fact: patterns_experiments_and_tests is 1.0.0+1
SLVR: derived: patterns_experiments_and_tests
SLVR: fact: patterns_experiments_and_tests requires SDK version >=2.9.0 <3.0.0
SLVR: conflict: patterns_experiments_and_tests requires SDK version >=2.9.0 <3.0.0
SLVR: Version solving took 0:00:00.060030 seconds.
| Tried 1 solutions.
FINE: Resolving dependencies finished (0.1s).
ERR : The current Dart SDK version is 2.9.0-21.0.dev.flutter-2e05e6c94a.
|
| Because patterns_experiments_and_tests requires SDK version >=2.9.0 <3.0.0, version solving failed.
FINE: Exception type: SolveFailure
FINE: package:pub/src/solver/version_solver.dart 312:5 VersionSolver._resolveConflict
| package:pub/src/solver/version_solver.dart 133:27 VersionSolver._propagate
| package:pub/src/solver/version_solver.dart 97:11 VersionSolver.solve.<fn>
| ===== asynchronous gap ===========================
| dart:async Future.catchError
| package:pub/src/utils.dart 113:52 captureErrors.wrappedCallback
| package:stack_trace Chain.capture
| package:pub/src/utils.dart 126:11 captureErrors
| package:pub/src/command_runner.dart 193:13 PubCommandRunner.runCommand
---- End log transcript ----
pub get failed (1; ---- End log transcript ----)
Process finished with exit code 1
It should be noted here that flutter doctor -v reports that everything is pretty 'OK' in the project:
[✓] Flutter (Channel master, 1.21.0-5.0.pre, on Mac OS X 10.15.5 19F101, locale ru-RU)
• Flutter version 1.21.0-5.0.pre at /Applications/flutter
• Framework revision 2a063fc6c0 (11 дней назад), 2020-07-17 12:51:01 -0400
• Engine revision 1493883bf0
• Dart version 2.9.0 (build 2.9.0-21.0.dev 2e05e6c94a)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at /Users/sergeglushenko/Library/Android/sdk
• Platform android-30, build-tools 30.0.0
• 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 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.8.4
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.5 19F101
Would you please suggest me what should be done to make Dart non-nullable syntax steadily usable in Android Studio (latest version)?
I think this issue was being resolved with the new version. The migration guide for null safety is out now a mentioned in this comment:
Please read https://dart.dev/null-safety/migration-guide. You can't
just turn on null safety. We have docs and migration tooling available
for you!
And if it still doesn't work, try the suggestion here:
You should increase your current sdk version from sdk: ">=2.7.0
<3.0.0" to sdk: ">=2.12.0 <3.0.0" and run flutter pub get. If you
don't want to do that manually, you should run dart migrate --apply-changes in terminal. I recommend the second one
I recently updated the Android Studio, After that project is not running.
flutter run -v
Gradle task assembleDebug failed with exit code -1
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 buildGradleApp (package:flutter_tools/src/android/gradle.dart:387:7)
#2 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#3 _rootRunUnary (dart:async/zone.dart:1134:38)
#4 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#8 Future._completeWithValue (dart:async/future_impl.dart:524:5)
#9 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
#10 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
#11 _DefaultProcessUtils.stream (package:flutter_tools/src/base/process.dart)
#12 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#13 _rootRunUnary (dart:async/zone.dart:1134:38)
#14 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#15 _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#16 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#17 Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#18 Future._addListener.<anonymous closure> (dart:async/future_impl.dart:389:9)
#19 _rootRun (dart:async/zone.dart:1126:13)
#20 _CustomZone.run (dart:async/zone.dart:1023:19)
#21 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#22 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#23 _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#24 _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#25 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#26 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)
Then I run flutter doctor -v
doctor --verbose
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-IN)
• Flutter version 1.12.13+hotfix.8 at C:\Users\shiva\flutter_src\flutter
• Framework revision 0b8abb4724 (8 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\shiva\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = C:/Users/shiva/AppData/Local/Android/Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[!] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.5
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[√] VS Code (version 1.44.0)
• VS Code at C:\Users\shiva\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.9.1
[√] Connected device (1 available)
• ASUS X00TD • J9AAGF11K219NMK • android-arm64 • Android 9 (API 28)
! Doctor found issues in 2 categories.
Process finished with exit code 0
Problem is with licensing and all, then I run
flutter doctor --android-licenses
!Error
A newer version of the Android SDK is required. To update, run:
usersDirPath\AppData\Local\Android\Sdk\tools\bin\sdkmanager --update
Then I run
sdkmanager --update
It shows up
Warning: Unknown argument -v
Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:419)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
What I have tried
Changing jdk version to 8
https://github.com/flutter/flutter/issues/31116#issuecomment-529807607
Installing Android SDK 26.1.1 (obsolete)
https://github.com/flutter/flutter/issues/51670#issuecomment-593068819
Even uninstalling the android studio completely and installing it again.
Help me solve this error.
Android Studio version 3.6.2
Edit
I somehow(re-install) manage to accept all the licenses, but the error is still same.
Gradle task assembleDebug failed with exit code -1
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 buildGradleApp (package:flutter_tools/src/android/gradle.dart:387:7)
#2 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#3 _rootRunUnary (dart:async/zone.dart:1134:38)
#4 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#8 Future._completeWithValue (dart:async/future_impl.dart:524:5)
After running flutter doctor -v
[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.720], locale en-IN)
• Flutter version 1.12.13+hotfix.9 at C:\Users\shiva\flutter
• Framework revision f139b11009 (12 days ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\shiva\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• 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_212-release-1586-b04)
• All Android licenses accepted.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[!] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.5
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[√] VS Code (version 1.44.0)
• VS Code at C:\Users\shiva\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.9.1
[√] Connected device (1 available)
• ASUS X00TD • J9AAGF11K219NMK • android-arm64 • Android 9 (API 28)
! Doctor found issues in 1 category.
Currently I'm trying to upgrade a Xamarin.Forms project to use .NET Standard 2.0. This went fine for Android but I'm getting stuck with the iOS version. To build iOS we use a On-Primise MacMini as build agent int VSTS. Now I'm getting the error below when building the solution.
=================================
.... way more erros like below ...
2017-11-21T11:39:43.8920830Z ViewModels/DashboardViewModel.cs(66,35): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/Admin/BuildAgent/_work/3/s/xxx.App/xxx.Core.csproj]
2017-11-21T11:39:43.9014700Z ViewModels/DashboardViewModel.cs(66,73): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/Admin/BuildAgent/_work/3/s/xxx.App/xxx.Core.csproj]
2017-11-21T11:39:43.9036150Z ViewModels/DashboardViewModel.cs(66,93): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/Admin/BuildAgent/_work/3/s/xxx.App/xxx.Core.csproj]
2017-11-21T11:39:43.9053280Z
2017-11-21T11:39:43.9083060Z 6 Warning(s)
2017-11-21T11:39:43.9107960Z 47 Error(s)
2017-11-21T11:39:43.9116100Z
2017-11-21T11:39:43.9131830Z Time Elapsed 00:00:59.23
2017-11-21T11:39:43.9327960Z ##[error]Xamarin.iOS task failed with error Error: /Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild failed with return code: 1. For guidance on setting up the build definition, see https://go.microsoft.com/fwlink/?LinkId=760847.
2017-11-21T11:39:43.9575950Z [command]/usr/bin/security delete-keychain /Users/Admin/BuildAgent/_work/3/s/_xamariniostasktmp.keychain
2017-11-21T11:39:44.2658340Z ##[section]Finishing: Build Xamarin.iOS solution xxx.sln
=================================
This output comes from the following build definition:
Now I've searched the internet and found a view possible solutions:
Update Visual Studio on the MacMini
Update XCode on the MacMini
Install .NET Core 2.x SDK on the MacMini
Add .NET Standard 2.x NuGet package to Xamarin.IOS project
Add .NET Standard Library NuGet pre-release package to Xamarin.iOS project (not possible)
Manually reference netstandard.dll to the Xamarin.iOS project
Remove install argument (not using it)
But all of this was not enough to fix the issue. Now I'm not a expert in using a Mac. Actually I never touched one before this issue... So I might have done something wrong here...
But I've been able to get some version information about all products on the MacMini:
========= Visual Studio =========
Visual Studio Community 2017 for Mac
Version 7.2.2 (build 11)
Installation UUID: b43353ef-651c-468b-8b7d-3f1714586419
Runtime:
Mono 5.4.1.6 (2017-06/1f4613aa1ac) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 504010006
NuGet
Version: 4.3.1.4445
.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.3
SDK: /usr/local/share/dotnet/sdk/2.0.3/Sdks
SDK Version: 2.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
Version: 1.5.6
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Xamarin.Android
Not Installed
Xamarin Inspector
Not Installed
Apple Developer Tools
Xcode 9.1 (13532)
Build 9B55
Xamarin.iOS
Version: 11.3.0.47 (Visual Studio Community)
Hash: 51128b8c
Branch: xcode9.1
Build date: 2017-10-31 22:42:13-0400
Xamarin.Mac
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.
Build Information
Release ID: 702020011
Git revision: b604c37c5a4a2f0919b45ffbe2aaad9fe040af31
Build date: 2017-11-01 08:31:43-04
Xamarin addins: d57dc14cbd4eb166ee62bab585965ab78d3650bc
Build lane: monodevelop-lion-d15-4
Operating System
Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
Wed Oct 4 00:17:00 PDT 2017
root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64
============= XCode =============
XCode for Mac
Version 9.1 (9B55)
============= Mono ==============
Mono JIT compiler version 5.4.1.6 (2017-06/1f4613aa1ac Wed Oct 18 09:31:57 EDT 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: yes(3.6.0svn-mono-master/8b1520c8aae)
GC: sgen (concurrent by default)
========= .NET Core SDK =========
.NET Core SDK
Version 2.0.3
=================================
The project can be build on the MacMini itself. Only the VSTS task keeps failing...
Does someone have any idea's left which can help me solve my issue?
Kind regards,
Jop
Everything started to work fine after we manually edited the .NET Standard 2.0 project file (*.csproj) and add a PackageReference by hand.
<ItemGroup>
...
<PackageReference Include="NETStandard.Library" version="2.0.0" />
...
</ItemGroup>
While compiling ITKSNAP using ITK,VTK and FLTK on my computer(Windows 7 and Microsft visual studio 2012) shows following error:
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
FLTK_FLUID_EXECUTABLE
CMake Error at CMakeLists.txt:570 (ITK_DISABLE_FLTK_GENERATED_WARNINGS):
Unknown CMake command "ITK_DISABLE_FLTK_GENERATED_WARNINGS".
I don't know how to link fluid executable.
Please suggest some solution.