How to select Development team for iOS app created in Flutter - flutter

I am trying to deploy an iOS app to Device using Google's Flutter, but I get this error on the command line:
Building an iOS app requires a selected Development Team with a Provisioning Profile
Please ensure that a Development Team is selected by:
1- Opening 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
For more information, please visit:
https://flutter.io/setup/#deploy-to-ios-devices
Or run on an iOS simulator
Where and how do I do this? There is no "ios/Runner.xcworkspace" in the project. I know the installed Certificates and Provisioning profile work on my Mac, because I created and installed an app on my iOS device using Appcelerator, and it found everything I needed, and ran perfectly on device.

Select Runner, and navigate to Signing & Capabilities, under Signing, check Automatically manage signing, after that choose a Team from the list, and you're done.

You have to sign in with your appleID at 'signing'. After that you can select your 'personal team'.

open ios/Runner.xcodeproj and follow the same instructions should work? Runner.xcodeworkspace is a relatively new addition to the template, created to allow Flutter projects to integrate better with CocoaPods.
If that doesn't work, please let us know.

Related

How to build an iOS AdHoc app with flutter

I have an flutter app for ios and can build it for the app store using:
flutter build ios --release
But how can I build an Ad-Hoc app for ios?
Pre-requisite
Apple Developer Program membership ($99/year)
Distribution certificate added to your machine
In the Xcode project (Signing & Capabilities tab), select your team/ developer account which has the Apple Developer program membership.
1. Create an Archive (.xcarchive)
Technically you do not build an Ad Hoc app, you build a debug/release/profile app, which you then distribute via a distribution method, one option is Ad Hoc.
Using command line: You can run flutter build ipa to build the xcarchive. Then it should show a URL for your Runner.xcarchive at the output (double click that link), or
Using Xcode: Open the Xcode project, and in the menu bar, click Product > Archive. The organizer window will open once the archive is complete.
2. Create an .ipa
Now the Organizer window should be open. Press the Distribute App button: you should see multiple options. You can share the .ipa file with users, and they can install it onto their iPhone:
It's worth noting you can also create an .ipa using xcodebuild, but when you're first learning, it's nicer to use Xcode.
3. Install the .ipa on a device.
I wrote an answer about that: https://stackoverflow.com/a/68968301/7365866
Reminder
Just remember to do this:
Action Required: You must set a build name and number in the pubspec.yaml file
version field before submitting to the App Store.
You can use Code Magic's CLI tool to achieve that.
On their CLI (locally installed or on your CI server), there is an option to add
--type IOS_APP_ADHOC
See at the end of their signing documentation section for Specifying code signing configuration
You can use --export-method in the flutter build command, example:
flutter build ipa --release --export-method=ad-hoc
For Someone out there, who have trouble building ios application since they don't have an apple developer account, here's a method that i do and i use.
1st if you are an ios user you can connect your ios device into your mac and do a flutter run --release. you can also do it with just the simulator too and it does works the same.
Now, the ios app is created, using your 7 days free trial developers provisioning profile, what we need is to use some programs likie imazing,apple configurator or itunes, to get the ipa from inside the app.
Now you have build the ios app with a release version, and you can redistribute it with just a 7 days free trial version of yours.

No account for team "null"

$ flutter ios build --release
It shows Multiple valid development certificates available (your choice will be saved):
However it doesn't show the distribution certificate selection, I use --release flag though,,,
I checked I have installed production certification correctly in local machine.
Is there any clue to solve??
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
note: Using new build systemnote: Planning buildnote: Constructing build descriptionerror: No account for team "null". Add a new account in
the Accounts preference pane or verify that your accounts have valid credentials. (in target 'Runner' from project 'Runner')error: No
profiles for 'jp.****.****' were found: Xcode couldn't find any iOS App Development provisioning profiles matching
'jp.****.****'. (in target 'Runner' from project 'Runner')
#whitebear, I am assuming you're trying to release your iOS app? Have you tried manually configuring distribution certificate in Xcode? I usually do this,
Open Runner.xcworkspace in Xcode
Configure distribution certificate in Xcode
Run flutter build ios in Android Studio project terminal
Then archive in Xcode to publish
To address the 'No Account for team null' issue.
Make sure you have the DEVELOPMENT_TEAM build setting set properly.
I think this is because when you are sign your app with a a provisioning profile associated with a development team Xcode expects your DEVELOPMENT_TEAM building setting to match.
I typically let XCode Automatically Manage Signing when I'm building/running my app in development and thought that doing so would automatically set the DEVELOPMENT_TEAM build setting, but that doesn't seem to be the case.

It appears that your application still contains the default signing identifier

The flutter app was working completely fine. After few days when i tried to run in ios device it said like this "open xcode and try product -> run and try fixing it . After doing this and still showed me the same error".
Product -> run ,
flutter clean ,
flutter packages get ,
open ios/Runner.xcworkspace ,
signing in General(target) ->select team
If anyone had their app running before and faced this error, what worked for me was (note I am using a Macbook pro), was to open up the terminal first.
Then navigate to the project folder and typing in open ios/Runner.xcworkspace.
This command will open up your xcode. From there you can select you device on the top (emulator or physical ios device), and click on run.
Once it builds and runs successfully, it will fix the issue you are facing, now you can go to VS code or android studio and try flutter run and it should work.
If you see this error when trying to run your app on your iPhone for the first time, it's because your xCode signing identifier contains a default one and needs updating.
Here's how to solved this issue:
In VsCode, right click the ios folder and click Xcode.
In XCode, click Runner , The top option on the left then 'Signing & Capabilities'
Click 'Automatically manage signing'
Select your Team, if you don't have one setup, click 'Add an account' and continue to the next step.
Select "Add your Apple ID"
Click Manage Certificates then click the '+' button located in the corner , then click 'Apple Development' to add a signing certificate.
Click Done. Signing Certificate should display 'Apple Development: yourAppleID..."
Select your connected iPhone from the build destination dropdown - see screenshot
Click the big play button to run the build in xCode
Trust your iPhone - Open your iPhone settings > General > Device Management or VPN & Device Management > Under Developer APP, select Apple Development : your appleID > Click Trust "Apple Development: "your apple id...."
Open vsCode and run flutter clean && flutter run.
To Fellow up with Harsh, if you have no paid Apple Developer license, your certificate runs out after a week.
In my case, I needed again to trust my developer certificate on my iPhone, again. Before that, I also received your error. If you open up your app with Xcode, you will see the real error message.
Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator. (in target 'Runner' from project 'Runner')
You are encountering this error because com.example hasn't been registered as a Bundle ID on your developer account. I encountered this error while trying to use platform methods. I rectified the issue by creating a new Bundle ID on my Apple Developer Account - something like com.abc.appName. Here, abc is the name of my company. And then created a new project with this Bundle ID. Open up Xcode and under Runner -> Runner Target -> Signing and Capabilities add your Team name and make sure the automatically manage signing option is turned on
My issue was that I added the exclusion of arm64 in Xcode because my simulator was not running due to some dependency (google map?). When i deleted this arm64 exclusion for ios sdk (left it for simulator) inside xcode, runner, build settings, excluded architecture. The app could run again on physical device.
The default signing identifier is com.example.
Sounds like you haven't changed it.

Error when trying to launchIOSDevice using NetBeans Gluon Plugin / Apple Free Provisioning

I've successfully run a simple Gluon application using NetBeans 8.1, Gluon plugin, javafxports 1.0.7, Mac OS X 10.11.1, Xcode 7 using Gluon Mobile - Single View Project. When I try to run on my connected iPhone 6 using launch | launchIOSDevice, however, I'm having errors with the provisioning. Error message is Execution failed for task ':createIpa'.
No signing identity found matching '/(?i)iPhone Developer|iOS Development/'
I setup an identically named project on Xcode and ran it on my connected device. I verified that I have Provisioning Profiles and Signing Identities defined for my project (Xcode | Preferences | Accounts). I verified that the Xcode project Bundle identifier is the same as the ios CFBundleIdentifier as defined in the Default-info.pllist file. I tried defining ios properties iosProvisioninProfile and iosSignIdentity in the build.gradle file. This gave different error messages, but the build still failed.
Has anyone successfully run a NetBeans/Gluon-Mobile app using Apple's Free Provisioning on a connected IOS device? I'm sure I'm doing something wrong, but need help figuring it out!
Thanks in advance!
I didn't try it with a free provisioning profile. I did it with an apple developer account, but here are the steps I've taken maybe it can help you:
Get accepted as an apple developer (not your case)
Go to XCode, click code->preferences
Go to the accounts tab
click the plus button to add an account. Add your account.
Click file->new project->single view application
Put whatever product name and organization identifier (it doesn't matter)
Choose whatever place you want to store the project
For any issue that arises like "no non-expired provisioning profiles were found", click fix issue.
Connect ios device and run app.
start gluon ios gradle task (for instance 'launchIOSDevice')
It will take a lot of time the first time. In the end it may give you a java.lang.OutOfMemoryError. Put in your gradle JVM settings: '-Xmx2000M'.
Start ios gradle task again.
You can also check: http://docs.robovm.com/getting-started/provisioning.html#limitations for free provisioning advise, but you probably already have.
You can use a free provisioning account. You just need to add a couple of lines to the build.gradle file in the iOS settings:
iosProvisioningProfile = 'xxxx'
iosSignIdentity = 'yyyy'
The ProvisioningProfile is the file name of the provisioning provisioning profile you created in xCode. Just right click, and choose "Show in Finder". Just copy the file name (you don't need to copy the "mobileprovision" extension.
The SignIdentity (yyyy) you can get with by opening a terminal and entering the following command:
security find-identity -v -p code signing
Look for the line that contains "iPhone Developer: " line and copy everything in the quotes
You need a apple developer account (the free variant works fine). Then you create a xCode project that matches your Gluon project so that:
Product Name in your xCode project is the same as your Gluon project's Project Name
and...
Organization Identifier is the same as as your Gluon project's Package Name
Then it should work fine. I have made this in Eclipse and later in Netbeans - and it have worked in both places.
Edit: By using this way however you have resign your app (around every 24h) - which means opening the project (that you created before that is being similar to your Gluon project) - letting xCode revalidate the project with your developer id. If you do not do this you will experience that your app doesn't open, (but it will be shown/exist among other opened apps - when you double tap the home button on iPhone).

Unable to debug in ipad

I am using Xcode 4.6.x and the iPad iOS version is 6.1.3. I have added the device in Provisioning Profile. But when i connect it does not allow me to debug.
I have checked the Base SDK, it is 6.1 and Deployment Target is 6.1. I have tried to switch off and restart the iPad, but it's not working yet.
Can anyone help me ?
First clean your project [alt + clean] i.e. Clean Build Folder, Quit xCode, then remove app from your device.
Now build project and run. Delete all data from Derived Data folder. Also make sure you are not using distribution profile.
Hopefully this will work.
Check it once again the device id, add to provisioning profile.
Remove old provisioning profile.
Remove the app from the device. and remove form DerivedData folder also
Than add latest provisioning profile.
Than try to debug hopefully its work.