I've developed an application with Flutter with Android Studio. Now I want to build the app for iOS. I installed xCode on my Mac and git cloned the repository from github in xCode. How could I open the project in xCode? If I try to open the folder i get "Unable to open the file".
With Xcode You can open ios specific part of the project which is located in ios/xcworkspace.
To open a Flutter project in Xcode, you first need to make sure that you have built the correct Flutter files for ios, so, first, run:
flutter build ios
And then open your file under the directory ios/MYPROJECT.xcworkspace
Related
I have built and published a cordova app with android on my windows PC.
I have copied entire cordova project to a usb drive and transferred the project to a Mac to publish the iOS version.
I can navigate to the platforms/ios directory and open the xcode workspace file. When I try to build the project for the emulator I get the message:
pods-debug.xcconfig:2:could not find included file 'Pods/Target Support Files/' then the reference is to my windows files: C:\path\platforms\ios...
I have tried to deintegrate and reinstall pods through the terminal, and I can remove them and but i get a message saying that 'the workspace referencing the Pods project still remain'
and the problem with building persists.
I suspect that I need to try and rebuild the pods in Xcode but I do not know how.
To fix this, I had to reinstall cordova. using the command line I changed all permissions to allow me to update the $PATH so that cordova commands on the mac could be used.
Then I had to remove platform iOS and re-add it
The I had to go into into platform/ios and run these commands:
pod deintegrate
pod install
After that I could enter xcode by clicking on the workspace and I could perform a test build
I've deleted my React native project while trying to make Google maps work on Xcode being .xcodeproje and .xcworkspace. Which means I am unable to run IOS simulator.
I've tried deleting Xcode and reinstalling but it doesn't find the react native project on Xcode. Tried linking the files and creating another project but no result. It gives the error below when I try building the simulator. The files that were in the deleted file are in my VS Codde within the ios file.
react-native run-ios --simulator="iPhone7"
error Could not find Xcode project files in "ios" folder. Run CLI with --verbose flag for more details.
Upgrade your react-native project to restore your deleted files.
1 - Delete your ios and android folder
2 - In your project directory:
react-native upgrade
3 - link for any native dependency:
react-native link
4 - And after that:
react-native run-ios
this is the second part of a bigger problem where the first part was solved here React native project deleted on xcode, can't run "run-ios react-native".
I have deleted my project on Xcode may it be .xcworkspace or .xcodeproje.
Because of that, I had to delete IOS and android folders while downgrading, updating and re-upgrading my react version to re-install IOS and android folders.
Thanks to that the emulator is working but unfortunately the project isn't present in the emulator and is still absent with Xcode. One thing to point out is that the simulator only appears when ran in the integrated terminal and nor in general terminal after cd-ing in the project folder.
Can anyone please help re-integrating the project in the emulator and on Xcode please.
Here is the error when the emulator is running in a general terminal:
error Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Here is the error for building the project within emulator when ran from VS code integrated terminal:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening project.xcodeproj
In Xcode, select Xcode menu, then Preferences, then Locations tab. Click on the advanced button, select legacy and exit Xcode.
I finished up my small flutter app, where I am using a webview (webview_flutter: ^0.3.5+3). All works great on simulator.
I have run flutter build iOS --release, selected runner from targets and set it to generic iOS device.
Now I want to archive it in Xcode but I keep getting this error about "Library not found for -lwebview_flutter"
I can't seem to find a solution and would really appreciate some help
If you're using Flutter plugins that installed Pods in the iOS build, make sure that you've opened the Xcode project with .xcworkspace
If that still didn't work, you can try regenerating the iOS build folder by deleting the /ios folder and run flutter create --platforms=ios to generate project files for the iOS build.
How can I open an existing Flutter project made by Android Studio on Mac-Os to export ipa version of app? Can it be done with Mac-Os version of Android Studio or I have to do it with X-Code? How?
Thanks in Advance
I could finally do that by accomplishing the following steps:
Copy the project into macOs (with X-Code Installed)
Open it by Android Studio (preferably latest version)
Enable Flutter and Dart plugin on Android Studio framework settings
Run command flutter packages get (Connection to Flutter repositories must be available)
Run flutter build ios --release as #Günter Zöchbauer truly commented
Connect iPhone device or simulator and run directly on your device
If some errors printed you may need to verify your developer account settings on X-Code or check Github page of your libraries for possible iOS issues
You can do it in XCode.
Ensure you run flutter build ios --release before you do.
Connection to physical iPhone device is not necessary. Run any sample project in xcode. Start a Simulator. (Only One simulator preferrably).
clone the repository from github into Mac (with X-Code Installed)
open terminal.
cd to your pubspec.yaml
flutter run (it will automatically run flutter pub get)
(It will launch on the already running iOS simulator)
follow steps on flutter.dev to install flutter. Above steps will only work from terminal if flutter doctor(any flutter command) is recognized