Flutter macOS high Sierra error - configuration

I follow the instruction on Flutter site. Flutter Doctor warning is below. My problem I don't know how to overcome from this error, warning etc.
Any help please?
/Users/niyazitoros/development/flutter/flutter/bin/flutter --no-color doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.2.3, on Mac OS X 10.13.4 17E199, locale tr-TR)
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] iOS toolchain - develop for iOS devices (Xcode 9.3)
✗ Missing Xcode dependency: Python module "six".
Install via 'pip install six' or 'sudo easy_install six'.
✗ CocoaPods installed but not initialized.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.io/platform-plugins
To initialize CocoaPods, run:
pod setup
once to finalize CocoaPods' installation.
[✓] Android Studio (version 3.1)
[✓] IntelliJ IDEA Community Edition (version 2018.1)
[!] Connected devices
! No devices available
! Doctor found issues in 3 categories.
Process finished with exit code 0
After correcting the flutter path doctor gives me this warning.
/Users/niyazitoros/development/flutter/bin/flutter --no-color doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.2.3, on Mac OS X 10.13.4 17E199, locale tr-TR)
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] iOS toolchain - develop for iOS devices (Xcode 9.3)
✗ Missing Xcode dependency: Python module "six".
Install via 'pip install six' or 'sudo easy_install six'.
[✓] Android Studio (version 3.1)
[✓] IntelliJ IDEA Community Edition (version 2018.1)
[!] Connected devices
! No devices available
! Doctor found issues in 3 categories.
Process finished with exit code 0

to fix the android SDK licence error go on your terminal and type
flutter doctor --android-licenses
then
pip install six
if the error still persists run
flutter upgrade

If anybody still have the problem with pip six
Uninstall python2
brew uninstall python#2
this one is worked for me.

you can fix android SDK license by using
flutter doctor --android-licenses
next you run
pip install six

Related

How to develop Flutter web app on Windows Subsystems for Linux (Debian 10)

I would like to develop Flutter web app on Windows Subsystems for Linux (Debian 10). I followed this instruction. https://flutter.dev/docs/get-started/codelab-web
flutter channel beta
flutter upgrade
flutter config --enable-web
First, I input these commands in my terminal and all of them worked fine.
Second, I tried flutter doctor command and this is the result.
Downloading android-arm-release/linux-x64 tools... 2.1s
Downloading android-arm64-profile/linux-x64 tools... 1.8s
Downloading android-arm64-release/linux-x64 tools... 1.6s
Downloading android-x64-profile/linux-x64 tools... 1.6s
Downloading android-x64-release/linux-x64 tools... 1.5s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.18.0-11.1.pre, on Linux, locale en_US.UTF-8)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
[✓] Connected device (1 available)
! Doctor found issues in 3 categories.
I develop web app, so I don't need Android toolchain and Android Studio, but I need Chrome.
I think there are two ways.
install Chrome on WSL => I searched the Internet, but I couldn't find the way to do so.
user Chrome on Windows 10(not WSL) => I searched the Internet (for example:flutter chrome "windows subsystems for linux"), but I couldn't find the way to do so.
Could you give me any advice?
Try setting the environment variable CHROME_EXECUTABLE to the path of the Chrome executable installed on Windows, so Flutter can locate it.
Turns out, you just need to tell flutter where chrome.exe is located on your host windows machine!
One way to do this is to use GUI Apps, which unfortunately requires WSL version 2 and Windows 11. Read More
Making WSL and GUI Apps ready
If you don't already have wsl, run Powershell in Admin mode and run
wsl --install -d Ubuntu
sudo apt update
change the distro as you like
If you have, run these to make sure it's ready
wsl --set-default-version 2
wsl --update
wsl --shutdown
sudo apt update
Installing Google Chrome on WSL
Change directories into the temp folder: cd /tmp
Use wget to download it: sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Get the current stable version: sudo dpkg -i google-chrome-stable_current_amd64.deb
Fix the package: sudo apt install --fix-broken -y
Configure the package: sudo dpkg -i google-chrome-stable_current_amd64.deb
To launch, enter: google-chrome
You should be good to go
Running flutter doctor should mark web development as ready, and projects should run with this command:
flutter run -d chrome --web-renderer canvaskit
My WSL2(Windows 10 build 18363) did not recognise the environment variable CHROME_EXECUTABLE.
So, I also added the environment variable WSLENV to 'CHROME_EXECUTABLE/p'.
(https://adamtheautomator.com/windows-subsystem-for-linux/#Sharing_Environment_Variables)
Then, it works!

How to fix 'Google services version conflict (Maps / FCM)'

the problem happens after add google map plugin in this link
https://github.com/mapsplugin/ionic-googlemaps-quickdemo-v4
this google map work fine in ios but when I try to run it on android
get this error
[cordova] * What went wrong:
[cordova] Execution failed for task
':app:processDebugGoogleServices'.
[cordova] > Please fix the version conflict either by updating the
version of the google-services plugin (information about the latest
version is available at https://bintray.com/android/android-
tools/com.google.gms.google-services/) or updating the version of
com.google.android.gms to 10.+.
[cordova]
[cordova] * Try:
[cordova] 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.
[cordova]
[cordova] * Get more help at https://help.gradle.org
[cordova]
[cordova] BUILD FAILED in 38s
[ERROR] An error occurred while running subprocess cordova.
cordova build android exited with exit code 1.
I try all these solutions but not work for me but work for someone
1- https://forum.ionicframework.com/t/ionic-processdebuggoogleservices-version-conflict/132560
2- https://github.com/arnesson/cordova-plugin-firebase/issues/1093
3- https://forum.ionicframework.com/t/execution-failed-for-task-app-processdebuggoogleservices-please-fix-the-version-conflict-either-by-updating-the-version-of-the-google-services-plugin-version-of-com-google-android-gms-to-11-8-0/125610
4- https://forum.ionicframework.com/t/google-services-version-conflict-maps-fcm/93695/51
5- https://forum.ionicframework.com/t/google-services-version-conflict-maps-fcm/93695
The problem happens because I am using the old version from FCM plugin it works fine before adding google map plugin the conflict happens because of the 10.+ and 15.0.1 not the same and not compatible.
cordova.system.library.2=com.google.firebase:firebase-core:10.+
cordova.system.library.3=com.google.firebase:firebase-messaging:10.+.
and
cordova.system.library.4=com.google.android.gms:play-services-maps:15.0.1
cordova.system.library.5=com.google.android.gms:play-services-location:15.0.1
the solution is very simple and funny for me on these steps
1- uninstall fcm plugin using this command.
ionic cordova plugin rm cordova-plugin-fcm-with-dependecy-updated
2- install fcm plugin
ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated
3- remove the android platform
ionic cordova platform rm android
4- add android platform
ionic cordova platform add android
now everything is ok
go to android platform and open project.properties
you found the changes
like that
cordova.system.library.2=com.google.firebase:firebase-core:16.0.9
cordova.system.library.3=com.google.firebase:firebase-messaging:18.0.0
now run
ionic cordova run android
I hope that helpfull anyone thanks.

How to install xcode 7 and edit Swift 2.X on macOS Mojave version 10.14.3

In Case,
My project is using swift 2.X .
Once i installed Xcode 10. Xcode 10 is not available to code swift 2.X.
So i have to installed oldest version,
i go installed Xcode version 7.X , but not available to run on OS with the following problem message.
Xcode cannot be opened because of a problem.
Check with the developer to make sure Xcode works with this version of
macOS. You may need to reinstall the application.Be sure to install any
available updates for the application and macOS.
Any Solution to solve my problem??

Error building Ionic app using WP8 platform on MAC OSX

Happy that the Android .apk file I built using "ionic build android" worked on a Samsung Note phone.
I would like to try the same app but on a different hardware which is my Nokia Lumia Windows Phone 8.
So I added the platform wp8 first and it went well.
$ ionic platform add wp8
Updated the hooks directory to have execute permissions
WARNING: Applications for platform wp8 can not be built on this OS - darwin.
Adding wp8 project...
Running command: /Users/user01/.cordova/lib/npm_cache/cordova-wp8/3.8.2/package/bin/create /Users/user01/repos/myTabs/platforms/wp8 com.ionicframework.mytabs754813 myTabs
Creating Cordova Windows Project:
App Name : myTabs
Namespace : com.ionicframework.mytabs754813
Path : /Users/user01/repos/myTabs/platforms/wp8
Copying necessary files to /Users/user01/repos/myTabs/platforms/wp8
Updating project files
Running command: /Users/user01/repos/myTabs/hooks/after_prepare/010_add_platform_class.js /Users/user01/repos/myTabs
add to body class: platform-wp8
Installing "cordova-plugin-console" for wp8
Installing "cordova-plugin-device" for wp8
Installing "cordova-plugin-splashscreen" for wp8
Installing "cordova-plugin-statusbar" for wp8
Installing "cordova-plugin-whitelist" for wp8
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Installing "ionic-plugin-keyboard" for wp8
Saving platform to package.json file
A platform already exists - now updating the entry: android platform=android, version=undefined, locator=wp8
However, I got an error when I ran "ionic build wp8".
$ ionic build wp8
Running command: /Users/user01/repos/myTabs/hooks/after_prepare/010_add_platform_class.js /Users/user01/repos/myTabs
add to body class: platform-wp8
Running command: /Users/user01/repos/myTabs/platforms/wp8/cordova/build
ERROR: MSBuild tools not found
ERROR building one of the platforms: Error: /Users/user01/repos/myTabs/platforms/wp8/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/user01/repos/myTabs/platforms/wp8/cordova/build: Command failed with exit code 2
Take a closer look at the logs:
WARNING: Applications for platform wp8 can not be built on this OS - darwin.
It is only possible to build wp8 apps on Windows. Of course, you could use Bootcamp, Parallels or any other virtual machine.

Android Platform Guide trouble with adding a platform through the command line

I am following the installation guide: http://cordova.apache.org/docs/en/3.0.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide
As aa early info this is my issue.
C:\apps\hello>cordova platform add android
[Error: An error occured during creation of android sub-project.
Creating Cordova project for the Android platform:
Command failed to execute : ant jar
This is what i did:
I installed all Java Dev packages (everything)
I installed Apache ANT, and created the environment variables (they work)
I created environment variables for PATH for the adt-bundle
All i want is to
cordova platform add android
cordova emulate android
This is due to ANT tools could not find tools.jar in JRE lib directory. When I copied tools.jar from JDK lib directory to JRE lib directory, the problem was absolutely solved and the build was successful when I ran the command "cordova -d platform add android". Hope this helps you.
I got the same issue today. upon research I found that I need to install JDK instead of JRE.
Install JDK from this link
After installation, set the JAVA_HOME to C:\Program Files\Java\jdk1.7.0_45 [your JDK Path].
Hope this helps!!
I installed the JRE instead of the JDK... Im no expert on Java installations, but this was my error.