When I run:
pod outdated
on IOS to determine any pods that are outdated I get the following result:
....
Analyzing dependencies
The color indicates what happens when you run `pod update`
<green> - Will be updated to the newest version
<blue> - Will be updated, but not to the newest version because of specified version in Podfile
<red> - Will not be updated because of specified version in Podfile
The following pod updates are available:
- Flutter 1.0.0 -> 1.0.0 (latest version 1.3.300)
- Protobuf 3.9.2 -> 3.9.2 (latest version 3.10.0-rc1)
While version 1.0.0 of Flutter (in red) seems to be okay at the moment on IOS can someone please suggest how I can update this Pod?
I have upgraded Flutter using:
/Users/bob/Downloads/flutter/bin/flutter upgrade
The above command seems to make no difference per the pod version noted above. I would prefer everything be at the latest version but if it is not necessary knowing that information would be helpful as well.
Using:
/Users/bob/Downloads/flutter/bin/flutter doctor -v
reveals:
[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-US)
• Flutter version 1.9.1+hotfix.2 at /Users/bob/Downloads/flutter
• Framework revision 2d2a1ffec9 (3 weeks ago), 2019-09-06 18:39:49 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/bob/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.6.0
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• iPhone 11 Pro Max • 08EB7508-34DE-4797-8F33-3DEE671742E4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
• No issues found!
The problem comes from the podhelper.rb script (YOUR_PATH//flutter/packages/flutter_tools/bin/podhelper.rb). It generates a 'fake' Flutter.podspec file but it hardcodes the 1.0.0 podspec.
Resolve this by editing lines 155-190 of podspec.rb (for iOS app), replacing the json definitions for the podspec with the version you want to move to from the CocoaPods repo (e.g. here for v2.5). Run pod update and it will update to 2.5.
The next section in the script repeats the same error for macOS apps so you may need to repeat for lines 193-228.
I am testing this right now but if you navigate into app_project/ios/Flutter/Flutter.podspec you will see there is Flutter version hardcoded to 1.0.0
Now I am no expert in Flutter so I don't know if you are supposed to manually change this, to what version you should change it, if it even makes any difference and why flutter don't provide script when you perform flutter upgrade to also update this file and flutter version.
Update your podhelper.rb on this path to update Flutter version on iOS.
YOUR_PATH//flutter/packages/flutter_tools/bin/podhelper.rb
s.name = 'Flutter'
s.version = '3.0.0'
Flutter 1.0.0 -> 1.0.0 (latest version 3.0.0)
Related
I am trying to run my existing flutter application and I am getting this exception. How can I solve this issue?
Exception: [!] Your app is using an unsupported Gradle project. To fix this problem, create a new project by running flutter create -t app <app-directory> and then move the dart code, assets and pubspec.yaml to the new project.
Here are my Flutter doctor results:
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E287, locale en-EE)
• Flutter version 1.17.1 at /Users/varsik/Documents/flutterConfigurationFiles/flutter
• Framework revision f7a6a7906b (2 weeks ago), 2020-05-12 18:39:00 -0700
• Engine revision 6bc433c6b6
• Dart version 2.8.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/varsik/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] 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
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• Pixel 3 XL • 8B8Y0VETV • android-arm64 • Android 10 (API 29)
• No issues found!
Maybe you removed a line from the
project/android/app/build.grade
Try adding this Piece of Code
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
after the line
apply plugin: 'com.android.application'
I resolve this issue by syncing project with gradle files.In android studio from menu open File option and click option sync project with gradle files.
Could you check this solution The project is using an unsupported version of Gradle
If you have the backup of your project than go to
project/android/app/build.grade
copy all the code and paste it to your project app/build.grade file.
Clean Project
Now Enjoy. Your error will not appear.
Thankyou.
For everyone landing here after making changes to the gradle for firebase or smth, it might seem stupid but check that the autoformat(if you have it enabled) didn't make funny things like putting spaces between "->" or "+=" turning them into "- >" or "+ ="
I've been working on an app for months now and using Flutter, but whenever I upgrade Flutter, it is a huge pain because I have to wrestle to try to get it to build again. Usually manually cleaning up CocoaPods and pubspec.yaml is enough, but this time it hasn't.
I've upgraded my Flutter version to 1.14.6 from 1.10.7, nuked my pods and pubspec.yaml, nuked my installation of Flutter, my repository, and nothing worked.
Another weird thing about it is that I have the build running just fine with the same versions of flutter, dart, cocoapods, and ruby on the same branch on a different machine. Is there something cached somewhere that I am not cleaning up properly? When I try to build, it says it fails with errors, but unfortunately the log output doesn't actually show any errors, and only shows warnings. Here is a part of my log output:
8 warnings generated.
/Users/hallo/Documents/dev/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.1.1/ios/Classes/FLTGoogleSignInPlugin.m:138:13: warning: unused variable 'sourceApplication' [-Wunused-variable]
NSString *sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey];
^
/Users/hallo/Documents/dev/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.1.1/ios/Classes/FLTGoogleSignInPlugin.m:138:41: warning: 'UIApplicationOpenURLOptionsSourceApplicationKey' is only available on iOS 9.0 or newer [-Wunguarded-availability]
NSString *sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'UIKit' imported from /Users/hallo/Documents/HalloMonoRepo/hallo/ios/Pods/Target Support Files/google_sign_in/google_sign_in-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:514:51: note: 'UIApplicationOpenURLOptionsSourceApplicationKey' has been marked as being introduced in iOS 9.0 here, but the deployment target is iOS 8.0.0
UIKIT_EXTERN UIApplicationOpenURLOptionsKey const UIApplicationOpenURLOptionsSourceApplicationKey NS_SWIFT_NAME(sourceApplication) API_AVAILABLE(ios(9.0)); // value is an NSString containing the bundle ID of the originating application; non-nil if the originating application and this application share the same team identifier
^
/Users/hallo/Documents/dev/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.1.1/ios/Classes/FLTGoogleSignInPlugin.m:138:41: note: enclose 'UIApplicationOpenURLOptionsSourceApplicationKey' in an #available check to silence this warning
NSString *sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Could not build the application for the simulator.
Error launching application on iPhone 8.
Any help would be much appreciated as I have exhausted my ideas on what could be causing this error.
Pluto:hallo hallo$ flutter doctor -v
[✓] Flutter (Channel beta, v1.14.6, on Mac OS X 10.14.6 18G3020, locale en-US)
• Flutter version 1.14.6 at /Users/hallo/Documents/dev/flutter
• Framework revision fabeb2a16f (3 weeks ago), 2020-01-28 07:56:51 -0800
• Engine revision c4229bfbba
• Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/hallo/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.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_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 39.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.42.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.1
[✓] Connected device (1 available)
• iPhone 8 • C40DD8DB-5860-4B94-8D20-372074B6E7BC • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
• No issues found!`
Are you running on Android Studio? VS Code? Could you post your flutter doctor -v?
Other than that, all those errors comes from google_sign_in. Would recommend the following:
Remove google_sign_in (and comment any screens using this dependency)
Make sure you're following all the correct changes inside your iOS Folder
Use a different library. google_sign_in may not be up to date with all the latest Flutter changes.
If your code runs without that library, it clearly shows an error with the latest upgrade changes.
I fixed the issue by changing a variety of things. When I did the flutter upgrade, it changed my project.pbxproj file by adding this line
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${PODS_ROOT}/Fabric/run\"\n";
which caused a lot of errors. I deleted this line, changed the build system in Xcode to default (it was legacy), and then in the embed frameworks in Xcode, I removed Flutter.framework.
Just run flutter clean on your project, it did the trick for me.
I have upgraded my flutter recently, previously it was working fine with every package, but now there is one thing which is bothering me right now due to which my project is not running. This is the error happening cos of this package named PURE_MIXPANEL.
ERROR:
The current Dart SDK version is 2.3.1-dev.0.0.flutter-a0290f823c.
Because pure_mixpanel 1.0.7 requires SDK version >=1.19.0 <=2.2.1 and no versions of pure_mi
xpanel match >1.0.7 <2.0.0, pure_mixpanel ^1.0.7 is forbidden.
So, because flutter_app depends on pure_mixpanel ^1.0.7, version solving failed.
Running "flutter packages get" in flutter_app...
pub get failed (1)
From the internet, I have followed so many things like :
flutter upgrade
flutter channel master followed by flutter upgrade
flutter channel dev followed by flutter upgrade
So it upgraded my flutter successfully but it raised one problem that is the package is not at all supported but previously it was working.
Here is my flutter doctor -v result :
[✓] Flutter (Channel master, v1.5.9-pre.193, on Mac OS X 10.14.4 18E226, locale en-US)
• Flutter version 1.5.9-pre.193 at /Users/alok/flutter
• Framework revision 3a6acb8c25 (9 minutes ago), 2019-05-09 09:23:30 -0700
• Engine revision 644db5a49c
• Dart version 2.3.1 (build 2.3.1-dev.0.0 a0290f823c)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/alok/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.0, Build version 10A255
• ios-deploy 1.9.4
• CocoaPods version 1.6.0
[!] Android Studio (version 3.3)
PUBSPEC.YAML:
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
pure_mixpanel: ^1.0.7
There is no upgraded version of pure_mixpanel present on the web, and it is important in my project.
Any help would be appreciated. Thanks
Your SDK version is 2.3.1 and SDK for pure_mixpanel is sdk: ">=1.19.0 <=2.2.1"
Check: https://github.com/seenickcode/pure_mixpanel/blob/master/pubspec.yaml
I fix my by adding dart sdk location to env
for Windows
C:\src\flutter\bin\cache\dart-sdk
I've installed flutter but when I run flutter doctor to verify the installation, I get:-
Android SDK is missing command line tools
I've doubled checked that the command lines are installed.
What do I need to do remove this error?
I've included the full flutter doctor -v output below:-
$ flutter doctor -v
[✓] Flutter (Channel beta, v0.3.1, on Mac OS X 10.13.4 17E202, locale en-AU)
• Flutter version 0.3.1 at /Users/chris/flutter
• Framework revision 12bbaba9ae (2 weeks ago), 2018-04-19 23:36:15 -0700
• Engine revision 09d05a3891
• Dart version 2.0.0-dev.48.0.flutter-fe606f890b
[!] Android toolchain - develop for Android devices
• Android SDK at /usr/local/Caskroom/android-platform-tools/27.0.1
• Android NDK location not configured (optional; useful for native profiling support)
• ANDROID_HOME = /usr/local/Caskroom/android-sdk/3859397
✗ Android SDK is missing command line tools;
• Try re-installing or updating your Android SDK,
visit https://flutter.io/setup/#android-setup for detailed instructions.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.3, Build version 9E145
• ios-deploy 1.9.2
• CocoaPods version 1.5.0
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 24.1.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 24.1.2
• Dart plugin version 181.4668.60
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
On Android Studio open SDK Manager.
Go to SDK Tools tab.
Check if Android SDK Command-line Tools is checked. If not, check and apply the changes.
For some reason, after updating flutter and Android Studio, I got this error too. Seems like some new requirement that for some reason wasn't automatically installed.
This fixed it for me.
I think ANDROID_HOME and ANDROID SDK should be pointing to the same path and that is the SDK's root directory.
In my .bashrc (on LINUX), following are
export ANDROID_HOME=/home/myname/Android/Sdk
export PATH=/home/myname/Android/Sdk:$PATH
export PATH=/home/myname/Android/Sdk/platform-tools:$PATH
export PATH=/home/myname/Android/Sdk/tools:$PATH
export PATH=/home/myname/Android/ndk-build:$PATH
Just solved the problem. Here are my system settings:
System variable ANDROID_SDK_ROOT points to my Android SDK dir
In system Path variable, I have sdk/tools, sdk/platform-tools, and /flutter-dir/bin
Also make sure you don't have dulplicated directories. I previously downloaded another platform-tools and add it to Path, so I had to delete it and use the sdk's one.
After changing those things, I close the flutter cmd windows and run flutter doctor on PowerShell. Worked like a charm!
Please download the latest sdk build-tools to solve the problem of Android SDK is missing command line tools
Flutter looks promising, but now and then I am stuck. In this case the error states:
package:async/src/typed/stream.dart': error: line 56: class 'TypeSafeStream' overrides method 'firstWhere' of super class or interface 'Stream' with incompatible parameters
I am using the following code that should work:
new NetworkImage(googleSignIn.currentUser.photoUrl)
fluttor doctor outputs:
[✓] Flutter (on Mac OS X 10.13.4 17E139j, locale nl-NL, channel dev)
• Flutter version 0.1.2 at /Users/johngorter/Desktop/flutter/flutter
• Framework revision 8a65872ef9 (6 days ago), 2018-02-13 23:32:28 -0800
• Engine revision 05c5f817eb
• Tools Dart version 2.0.0-dev.22.0
• Engine Dart version 2.0.0-edge.3c4dccbd46f152be9e1b6ca95c57357e8e48057c
[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
• Android SDK at /Users/johngorter/Library/Android/sdk
• Android NDK at /Users/johngorter/Library/Android/sdk/ndk-bundle
• Platform android-27, build-tools 26.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_112-release-b06)
[!] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
brew install --HEAD libimobiledevice
brew install ideviceinstaller
✗ ios-deploy not installed. To install:
brew install ios-deploy
✗ CocoaPods not installed.
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 install:
brew install cocoapods
pod setup
[✓] Android Studio
• Android Studio at /Applications/Android Studio 3.0 Preview.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
[✓] Android Studio (version 2.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[!] IntelliJ IDEA Community Edition (version 2017.2.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
[✓] VS Code (version 1.20.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Dart Code extension version 2.8.2
[✓] Connected devices
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
! Doctor found issues in 2 categories.
I am not using IOS (for now) and I am using VSCode.. so the issues are not causing the errors...
Is it something I have done to cause this or is it a bug in the packages?
Switching to the master channel or
adding
dependency_overrides:
async: ^2.0.4
to pubspec.yaml
and run `flutter package upgrade should do as workaround until the problem is solved.