Cannot run first project under flutter - flutter

Mac with Mojave
Flutter installed
Flutter Doctor passed all the tests
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2018.3)
[✓] Connected device (2 available)
I started IntelliJ IDE, and clicked on create new project
I selected the Android Emulator: Nexus 5S, and the emulator opened up properly.
I clicked on the green arrow to run, but I got the following error message:
════════════════════════════════════════════════════════════════════════════════
No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with your Apple ID
in Xcode and create an iOS Development Certificate as well as a Provisioning
Profile for your project by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- In the 'General' tab, make sure a 'Development Team' is selected.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
5- Trust your newly created Development Certificate on your iOS device
via Settings > General > Device Management > [your new certificate] > Trust
For more information, please visit:
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/
AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Finished with error: No development certificates available to code sign app for device deployment
Any ideas?

It looks like it's trying to run on an ios device that doesn't have a valid certificate. Flutter doctor is saying there are 2 devices connected. If you have an ios device attached to your computer, try disconnecting it so that flutter doesn't try to use it instead of the emulator.

Related

Flutter apk not installing

I am unable to install my apk on an android device except only for this apk. I am using the flutter build apk command to generate apk. After sharing apk to some device it was getting app not installed as shown in this..
I am using VSCode and here I am sharing the flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19043.1466], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.63.2)
[√] Connected device (3 available)
Other apk's are working fine except this one on my device.
Try all these steps:
Make sure that you have enough storage space
Enable the installation from Unknown Sources
Make sure that the APK file isn’t corrupted or incomplete
try to clear cache of package installer and reboot
Check if the app is already installed in your device.
Check if the play protect option is enabled, if it is then turn off it in play store from navigation drawer.
Make sure “applicationId” in build.gradle file is unique.
Just go to the Settings --> Apps --> Click on your App. ---> In App info page at the action bar menu there will be an option called " Uninstall for All users " click that.
This type of issue is occur when you transfer apk file directly via any messaging platform or USB ... Some time it will happen and apk file will corrupt.. So I suggest to create a link for distribution of your app..
You can upload your apk in Google drive or use Firebase App Distribution or just WeTransfer. And Generate the link and then transfer that link....

fatal error: 'Flutter/Flutter.h' file not found running on MabookBook M1

I already tried all of this link and nothing
Xcode build done. 4,3s
Failed to build iOS app
Error output from Xcode build:
↳
objc[22045]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1ffbaf8f0) and ?? (0x11b1602b8). One of the two will be used. Which one is undefined.
objc[22045]: Class AMSupportURLSession is implemented in both ?? (0x1ffbaf940) and ?? (0x11b160308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
In file included from /Users/netolobo/development/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.28/ios/Classes/FLTPathProviderPlugin.m:5:
/Users/netolobo/development/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.28/ios/Classes/FLTPathProviderPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.1.0-13.0.pre.499, on macOS 11.1 20C69 darwin-arm, locale pt-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Connected device (2 available)
• No issues found!
I finally found the final solution!
Backup ios/Runner folder.
Delete the ios folder.
Run flutter create . in the previous folder where you have your project(cd users/user/"projects_folder") (this will recreate your ios folder).
Paste your Runner backup in the ios folder (into the project).
Open Runner.xcworkspace (into ios folder) and there, check the Version, the Bundle ID, all the info.
(If do you Have Firebase, you have to copy and paste again the Google Service-Info.Plist into the Runner folder (Always through Xcode) (If do you do this manually, it doesn't work).
Finally, flutter run and should work!

Flutter run lost connection to device in iOS

I did an app in android, now trying to run it in ios. I am getting the bellow error
Xcode build done. 35.2s
Configuring the default Firebase app...
Configured the default Firebase app __FIRAPP_DEFAULT.
6.34.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
6.34.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60900000 started
6.34.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see ....)
Waiting for iPhone 11 to report its views... 4ms
6.34.0 - [Firebase/Analytics][I-ACS025036] App Delegate Proxy is disabled
Lost connection to device.
Syncing files to device iPhone 11...
(This is taking an unexpectedly long time.)
I have other ios apps which are running perfect.
Running flutter doctor shows this
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B50 darwin-x64, locale
en-GB)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
[!] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)
! Doctor found issues in 2 categories.
Edit = Removed firebase
I removed the firebase thing and getting a plain message like this
Running pod install... 3.0s
Running Xcode build...
└─Compiling, linking and signing... 9.1s
Xcode build done. 35.8s
Waiting for iPhone 11 to report its views... 3ms
Lost connection to device.
Syncing files to device iPhone 11...
(This is taking an unexpectedly long time.) ⣻
Any idea what could be wrong?
Thank you.
You are using Firebase and you probably forgot to add firebase's GoogleService-Info.plist file to your IOS project from xcode.
Also sometimes you need to run pod install inside IOS project to install the required pods.
I know I'm already late here, but this could be caused by improper configuration from Google Map or other API keys from within iOS. Try running the app in Xcode and you will get a more helpful error message.
In my case, it was a Google Map API key missing.
Solution:
Open AppDelegate.swift
Add import GoogleMaps along with the other imports
Add the following statement above GeneratedPluginRegistrant.register(with: self): GMSServices.provideAPIKey("YOUR_API_KEY_HERE") where YOUR_API_KEY would be something like AIzaSyBHV....wZEIg from the Cloud Console.
You may be creating a Secondary App as described in FlutterFire docs. https://firebase.flutter.dev/docs/core/usage/
The Secondary APP just worked in an Android Environment for me. I found a workaround loading the options from the previously created.
In that way, it worked in IOS.
Something like this:
// Uses the default GoogleService-Info.plist
final Future<FirebaseApp> _firebaseDefaultApp = Firebase.initializeApp();
List<FirebaseApp> apps = Firebase.apps;
_firebaseSecondaryApp = Firebase.initializeApp(name: "SecondaryApp", options: apps[0].options);

my flutter app do not run in iphone device from android studio

When I run for the application from the xcode it works, and same thing
in simulator , but when I do the run from the Android Studio in iphone
device, It displays a white screen and then shuts down, and it appears
like this :
Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 7R6D66J964
Running Xcode build...
Xcode build failed due to concurrent builds, will retry in 2 seconds.
Xcode build done. 44.9s
Installing and launching...
Error launching application on iPhone.
flutter doctor :
[✓] Flutter (Channel master, 1.24.0-2.0.pre.55, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-JO)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Android Studio (version 4.1)
[✓] Connected device (3 available)
! Error: iPhone is busy: Copying cache files from device. Xcode will continue when iPhone is finished. (code -10)
• No issues found!
Open Xcode
go to Wondow -> Devices & simulator
your phone showing left side
right click on that and unpair
no pair the device and it's working properly

Flutter plugin project build breaks: #import module not found for iOS

I'm developing a Flutter plugin that was running until a minute ago.
I haven't changed my Flutter project or the generated Xcode workspace at all. But all of a sudden the iOS Runner build breaks:
/path/to/myplugin/example/ios/Runner/GeneratedPluginRegistrant.m:10:9:
fatal error: module 'nativeguest' not found
#import myplugin;
~~~~~~~^~~~~~~~~~~
1 error generated.
I haven't renamed or moved anything so I have no clue where this came from. I double checked there are no changes through my Git history.
I don't quite remember what happened except a few flutter clean and flutter run -d <udid> ops. I probably did these in both the plugin example folder and the plugin root folder.
My Flutter global setup is perfectly fine
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 1.19.0-1.0.pre, on Mac OS X 10.15.4 19E287, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.45.1)
[✓] Connected device (2 available)
• No issues found!
This turned out to be a Bundle ID issue. I renamed the bundle on flutter side in the .yaml, but the new name didn't reflect back to the Xcode project.
One must manually rename the following metadata entries of the generated Xcode Runner project
Runner > Runner > Info.plist: Bundle name
`Runner > Main Editor: Signing & Capabilities > Bundle Identifier
IMHO, this is such a bad dev experience on flutter part. Renaming on Android is another roller-coaster ride of having to edit multiple manifests and Gradle configs.
Due to so many separate config files, renaming or any project reorganization becomes such a risky act!