Why does xCode cannot build my flutter app with 'sqflite' not found error - ios

I'm trying to build my Flutter app for iOS using xCode and got error:
.../ios/Runner/GeneratedPluginRegistrant.m:10:9: Module 'sqflite' not found
When I'm trying to build application with flutter with command
flutter build ios
I don't have any problem. Application build successfully.
I tried to delete Pod directory in ios folder and then install pods from scratch
flutter pub get
pod install
How to fix this problem with xCode?

XCode gives this type of Error like Module 'something' not found, when sometimes the problem is somewhere else.
So, what I did is after running flutter build ios command, I didn't try to run it in XCode. Because it was giving these errors.
So, I archived the app and tried to publish in App Store Connect. Then I found the real issue/bug on my code.
App store doesn't support transparent logo or app icon. This was the bug in my case.
So you can try to archive and publish to app store connect. It may show you the real reason.

Change your target Destination to > Any iOS Device
This work for me

"I found the solution,
In the existing project, once you guys add sqflite dependencies
Profile file in IOS folder will not generate code
we need to remove Podfile in ios
rm ios/Podfile
and run the project again, it works for me."
Credit:thanks to viroth-geek

Related

I cant run my flutter project after updating to xcode 14... keep saying Unable to read project 'Runner.xcodeproj'

Unable to get Xcode project information:
2022-12-01 13:57:05.376 xcodebuild[71564:226197] Writing error result bundle to
/var/folders/6g/w7cqd0s54c33_20mrl4v2q640000gn/T/ResultBundle_2022-01-12_13-57-0005.xcresult
xcodebuild: error: Unable to read project 'Runner.xcodeproj'.
Reason: Project /Users/noel/Treegar/treegar-app/ios/Runner.xcodeproj cannot be opened because it is missing its
project.pbxproj file.
i keep getting this error when ever i run flutter run or flutter build ios.
i dont know what to do... it works fine on android but not on ios.
ive updated xcode and flutter same problem
flutter doctor -v
UPdate cocoapod to latest version
update flutter
update xcode
This error message indicates that the Runner.xcodeproj file is missing or cannot be opened.
This file is part of the Xcode project for your Flutter app and is necessary for building and running the app on iOS.
To fix this issue, try the following steps:
Make sure that you have the latest version of Xcode installed on
your computer. You can check for updates and download the latest
version of Xcode from the Mac App Store.
Make sure that you have the latest version of the Flutter SDK
installed on your computer. You can update Flutter by running the
flutter upgrade command in a terminal window.
Make sure that you have the latest version of CocoaPods installed on
your computer. You can update CocoaPods by running the
sudo gem
install -n /usr/local/bin cocoapods
command in a terminal window.
Make sure that you have a valid Xcode project file for your Flutter
app. If the Runner.xcodeproj file is missing, you can try running
the flutter create . command in the root directory of your Flutter
app to recreate the Xcode project files.
If the above steps do not help, you can try deleting the ios directory in your Flutter app and running the flutter create . command again to recreate the Xcode project files from scratch.
After trying these steps, try running the flutter run or flutter build ios command again to see if the issue has been resolved. If you continue to encounter errors, please provide more information about the specific steps you are taking and the full error message you are seeing.
try flutter clear and pubget.
or
try pod install
or
if it is not harmfull for your code try to delete ios folder and recreate it
in your project. may be this can work .

Ionic Xcode unable to open file(target app)

I haven't touched my Ionic projects in around 1-2 months.
All my projects were running perfectly then.
I go to try run them today and every single one of them is saying
Showing Recent Messages
/Users/jakelewis/Desktop/fifteen-project-e/ios/App/Pods/Target Support
Files/Pods-App/Pods-App.debug.xcconfig: unable to open file (in target "App" in project "App")
They were all running perfectly. I haven't updated Xcode yet to the latest because it's still in the process of downloading. What would cause this issue?
It's a nightmare.
Somethings I tried, removing the ios folder and npx cap add ios
Even went on GitHub and went to rollback versions I knew that ran perfectly on IOS before.
I am using capacitor on most of my projects.
This did not fix the issue.
close XCode
run ionic capacitor copy ios to build it.
run pod reintegrate and pod install (navigate to where the pod file is located first, ex: cd ios/App and then run "pod install" command)
open XCode again use ionic capacitor open ios command
This work for me
try this:
Close XCode
open a terminal, go to the project and execute
pod install inside your app folder (where Podfile is located)

Problem with running IOS simulator for my flutter app

I'm trying to run my flutter app on the IOS simulator and its not working. So tried on the most basic flutter app (create my_app and then tried to run it) and nothing seem to work!
Everything seems to work fine when I run it from the terminal until the linking and signing phase and that where I get the error, how can I fix it?
This is the error I get:
Unable to install
/Users/MyUserName/Desktop/my_app/build/ios/iphonesimulator/Runner.app on
82562E3A-E7BD-4FE0-9BF9-8BB9C7AD5F15. This is sometimes caused by a malformed
plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command
(domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to transfer ownership of path
/Users/MyUserName/Library/Developer/CoreSimulator/Devices/82562E3A-E7BD-4FE0-9BF9-8B
B9C7AD5F15/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoord
inationd/Library/InstallCoordination/PromiseStaging/98CD703F-760F-4AAE-B991-BC2E
82D37D17/my_app.app to installd
Underlying error (domain=MIInstallerErrorDomain, code=103):
Failed to transfer ownership of path
/Users/MyUserName/Library/Developer/CoreSimulator/Devices/82562E3A-E7BD-4FE0-9BF9-8
BB9C7AD5F15/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoo
rdinationd/Library/InstallCoordination/PromiseStaging/98CD703F-760F-4AAE-B991-B
C2E82D37D17/my_app.app to installd
Command: /usr/bin/xcrun simctl install 82562E3A-E7BD-4FE0-9BF9-8BB9C7AD5F15
/Users/MyUserName/Desktop/my_app/build/ios/iphonesimulator/Runner.app
Error launching application on iPhone 11 Pro Max.
Edit:
I updated my MacOS, Deeleted and reinstalled Xcode, I even tried to run the most simple swift app and I get always this same error, it looks like the build was successful but it unable to install. I still get this same error, what can I do?
This occurred when I opened the Simulator first and then updated XCode -- even without running the app until after XCode updated completely.
What worked for me:
Close Simulator completely (from the dock, right-click -> "Quit")
Close XCode (if applicable)
Run flutter clean
Re-open Simulator
Re-open XCode and let it compile
Run the app again
If it still does not work, try resetting the device at "Device" -> "Erase All Content and Settings..." from the Simulator menu.
I had the same issue a couple of days ago
What I did - and what fixed the problem - was to reset the simulator (Device -> Erase All Content and Settings), and then run $ flutter clean
You should now be able to run your app again
None of the above worked for me. I created another flutter application and copied it's ios folder to my project. Worked like a charm
Save time, just go to erase device content and settings from the emulator, then run flutter clean. App should run fine then.
Run flutter clean and then run your app again
If error persist, generate a new flutter project on Android studio. Replace the ${projectHome}/ios/Runner.xcodeproj folder with the ${newFlutterProjectHome}/iOS/Runner.xcodeproj. Your app should run fine now.
If error persist still, delete the ios folder and replace it with a new one copied from a freshly generated project.
This happens if the GoogleService-Info.plist is missing.
This also happens when you have updated your XCode and your simulator is in the background.
Close the simulator and open the Xcode, you will get an option to install additional tools, install them and then run the application.
An alternate solution is to run the Runner.xcworkspace app once from Xcode and this may fix it.
In my case it was because of hanging empty GoogleService-Info.plist file inside Xcode after migrating to new Firebase (FlutterFire) initialization.
Xcode is not a regular drag and drop IDE which directly maps project files to the ones in the file system. It rather caches file references. So even when you delete a .plist file, the Xcode still maintains a reference to it.
Simply opened Xcode IDE and removed .plist file (which updated project.pbxproj in turn). This helped me to compile the project fine.
I had this same issue recently. I found out I added my GoogleService-info.plist file to the subdirectory Runner and not the main Project directory Runner through xcode. I opened up xcode again, deleted the file and re-added it to the proper place and now everything is working correctly.
for this you have to give some value in CfBundleVersionShortString like
<key>CFBundleShortVersionString</key>
<string>1.0</string>
And Give the build value in Runner as 1.0 and version as 1.0
enter image description here
To be honest. it's really frustrating for the developers
This is how I fixed!
flutter clean
flutter pub get
go to ios folder
rm Podfile.lock
pod repo update
pod install
Then it works!

Unable to build iOS after renaming Xcode project flutter

I have an issue guys. For some reason, I decided to rename my Xcode project runner folder before sending to the apple store. Now I wanted to rebuild for iOS with this command: flutter build ios. But I get this error each time:
Expected ios/Runner.xcodeproj but this file is missing.
Application not configured for iOS
I also tried building this with Xcode. I got this error each time:
/Users/apple/FlutterProjects/kashbase/ios/Pods/Target Support Files/Pods-Kashbase/Pods-Kashbase.debug.xcconfig: unable to open file (in target "Kashbase" in project "Kashbase") (in target 'Kashbase')
What does this mean and how can resolve this? Any helpful effort will be greatly appreciated.

Flutter, Cannot Build For iOS: Missing .h-Files

Building our Flutter project fails on iOS. The following steps work without problems:
running on the XCode simulator (flutter run)
building in the terminal (flutter build ios)
running on a real device in debug mode (flutter run -d "abcd")
If I open the project in XCode, change the build target to "Generic iOS Device" and hit "Build" or "Archive" I get the following error:
/Users/.../development/testproject/ios/Runner/GeneratedPluginRegistrant.m:6:9: 'flutter_exif_rotation/FlutterExifRotationPlugin.h' file not found
After removing the FlutterExifRotationPlugin, the error reoccurs with the next plugin alphabetically, so I figured that plugins in general don't work at the moment.
I tried:
dev, stable and master channels of flutter
reinstalling XCode
reinstalling Flutter
create a new project and moving the old files there
But nothing worked so far.
Ok the solution was very simple. I had to open the .xcworkspace file instead of the .xcodeproject one.
One WEEK went down the pipe for this error. I hope that you, future reader, will find this comment useful.

Resources