issue with all >1.2 flutter version on mac - macos

17.5 ( last before 1.2 ) and when I try to upgrade to 1.2 or more I have
Warning: Podfile is out of date
This can cause issues if your application depends on plugins that do not support iOS.
See https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms for details.
If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/45197 for instructions.
To regenerate the Podfile, run:
rm ios/Podfile
I tried rm ios/Podfile
rm: ios/Podfile: No such file or directory
I follow issue and solution but not working with me ... Or did wrong things
If someone can help me thank you
[Edit] : I remove podfil, and It's ok, thank you for help

Find where your project file is stored in finder. Or by typing find ~/ -type f -name "YOUR PROJECT NAME" in terminal. list your files by typing ls and go into the ios file in your flutter project, then type rm Podfile. This should delete the podfile, and once you run the project again, the pods will be installed via flutter

Best thing to do here is regenerate the iOS Project.
If you have made any changes to the native solution (Xcode), meaning new view controllers, assets, or video files, etc, then make sure to back those up first.
Then delete the iOS project, from your flutter project workspace, and run the following command:
flutter create -i swift .
This will generate a swift solution, but if you're looking for objective-c then try this:
flutter create -i objc .
After the iOS project is recreated, you will need to clean the project, then make sure that the podfile exists in your project directory.
Then run:
cd ios
podfile install
After the podfile installs all the required dependencies, try a fresh deployment of your iOS project:
flutter run -d "Device Name" --release
But make sure that you are running flutter on the root directory, so:
cd ..

Related

shared preferences don't work on ios [Xcode Debug]

I am trying to save the data locally in my application trying to use the shared preferences, while on android and chrome everything is ok, on ios by problems. When I debug with xcode this warning comes out "shared_preferences_ios not found".
Follow this steps
Backup ios/Runner folder.
Delete the ios folder.
Run flutter create (your project name). 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!
If flutter run fails:
cd ios
pod install
cd ..
flutter run

How do I completely Uninstall Flutter SDK from Windows

How do I completely uninstall Flutter SDK from Windows?
I tried to delete the Flutter Folder I had cloned from GitHub but that's not working for some reason.
You have to delete flutter extension in Android Studio if you installed it, then, check envirment variables then you removes paths if exists. Finally, kill adb.exe if it's running (this may blocks you in removing folder)
Go to C drive and delete flutter folder completely, if it shows that it Opened in some app, then just restart the device and delete the folder again, it worked for me.
If you go to the dir where you cloned dir and delete it. That should remove the command line tool.
rm -rf flutter
re-install git clone https://github.com/flutter/flutter.git -b stable
Uninstall Flutter with its uninstaller.exe.
to do that
a. Go to the installation folder of Flutter.
b. Find uninstall.exe or unins000.exe.
c. double click and run it.

Unable to open Runner.xwworkspace file from project directory

While opening runner.xwworkspace from flutter project ios directory I am getting an error file does not exist.
Also while building it from xcode i am getting error ==> /bin/sh: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
Did you change anything in your iOS project? If not then I can recommend recreating the iOS project by running flutter create again e.g.:
Go to the root of your project and remove ios directory and then recreate the project:
rm -rf ./ios
flutter create .
Check also the output from flutter doctor.

ERROR: main.jsbundle does not exist - React Native 0.60.4

I'm trying to publish my first React Native app in App store and when I'll build in Xcode:
Product > Archive
appears some error, but i already have main.jsbundle
main.jsbundle does not exist. This must be a bug with
echo 'React Native
Screen Error:
You can generate a new main.jsbundle using this command.
react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
Run this command in your project directory.
In my case, I was able to fix the issue by removing main.jsbundle from Bundle Resources.
Open react native project in xcode
Check if Copy Bundle Resources build phase contains main.jsbundle
If it contains, remove it and build again
Clear watchman watches:
watchman watch-del-all
Delete node_modules:
rm -rf node_modules and run yarn install
Reset Metro's cache:
yarn start --reset-cache
Remove the cache:
rm -rf /tmp/metro-*
In Xcode, you should be able to find the main.jsbundle inside the Xcode project sidebar.
If it isn't there, then you should drag the main.jsbundle into your Xcode project (in the default template app you can find it at ios/main.jsbundle)
If it is in there, but red - then you need to build a copy of the main.jsbundle which you can do via react-native bundle (and some additional args which you can look up.
I was getting the error because of a bug in the code, instead of using simulator I was using Xcode to install a release build to my device which led to this error.
To fix this, run the app on the simulator make sure it builds and runs properly and then install it on your device.
Try this instead
Go to Xcode
Go to targets
Select Build phases from the top
Just remove main.jsbundle lib from Copy Bundle Resources in build phase
re-run again.

Fixing file 'project.pch' has been modified since the precompiled header was built error in Xcode

I was recently working on my application messing around in the info.plist section, and since that my application will not run on my test device:
file 'project.pch' has been modified since the precompiled header was built
Something to note is that the app runs fine in the simulator.
Edit: Now I am getting this error instead of the other one:
No such file or directory (/Users/Me/Library/Developer/Xcode/DerivedData/MyProject-abcdefghijklmnopqrstuvwxyz/Build/Products/Debug-iphoneos/MyApp./MyApp)
How to regenerate the info.plist file?
You could try a deep clean (not the same as Product > Clean) - Option+Command+Shift+K
Note: this means the clean the build folder (by pressing Option + Product -> clean folder)
Close your project or workspace.
In Finder: ⇧shift+⌘cmd+G
Paste: ~/Library/Developer/Xcode/DerivedData/
Delete the ModuleCache folder and empty trash.
Open up your project.
Clean: ⇧shift+⌘cmd+K
Build: ⌘cmd+B
In my case the error message had a small hint:
note: after modifying system headers, please delete the module cache
at
'~/Library/Developer/Xcode/DerivedData/ModuleCache/5CYAJ91AZCB7'
I tried and it worked.
Simply touching the project's pch file solved this issue it for me :
touch Test.pch
Product -> Clean
Product + Option -> Clean Build Folder
Close Project or Workspace
Clean 'ModuleCache' path in Finder.
Worked for me in Xcode6 GM and iOS 8.0.
When the .h file of a Library Provided with Xcode is changed (even a space), this error could occur.
The following maybe tried in order to fix this issue
In, Project -> Build Settings, change Precompile Prefix Header to NO
OR
Run rm -rf ~/Library/Developer/Xcode/DerivedData and Clean Build
I constantly had this since upgrading from Xcode 4.6 to Xcode 5 with iOS projects when using command line build (xcodebuild).
What worked for me is to use this as command line build command:
xcodebuild -project path/to/my.xcodeproj -configuration Debug clean build
Before this, I've tried:
Clean the project in Xcode GUI.
Delete the offending pch file.
Delete the offending pch file's parent folder.
Delete the DerivedData project folder.
None of the above worked for me under Xcode 5.0.2, Mavericks, iOS7.
Note that the problem didn't happen to me when using Xcode GUI.
I just go to directory "/$HOME/Library/Developer/Xcode/DerivedData/", delete everything there
Just Click Product from the menu and select Clean
Product>Clean
Worked fine for me.
I got the same problem. My error said like I need to delete the cache in the below locaition,
Users/myusername/Library/Developer/Xcode/DerivedData/ModuleCache/3FGETKFCU0N0W
3FGETKFCU0N0W was a folder, when I deleted it and then clean build the project. Then the error disappears.
rm -rf ~/Library/Developer/Xcode/DerivedData/
If you use AppCode you can try remove content form:
/Users/[Username]/Library/Caches/appCode30/DerivedData/
Worked for me :)
Also, just open terminal, and delete the .pcm file that has been generated (Xcode 6 onwards)
rm <path-to-pcm-file>
If you get this when switching between git branches, try adding this post-checkout hook which will clean your project every time you change branch.
!/bin/sh
xcodebuild clean -configuration Debug
Save as .git/hooks/post-checkout relative to your project root and don't forget chmod +x .git/hooks/post-checkout
For me, this problem is only occurring in Xcode 6 beta version, So I switch back to Xcode 5, and now problem is solved.
I tried all the steps suggested by all users here, but no one worked for me.
So, if you have both versions of Xcode and have issue only in Xcode 6 beta, then switch to Xcode 5 and clean the project, problem will be solved.
I tried these one by one but failed to build and run my project. So I changed Precompile Prefix Header to NO as mentioned by #Abhilash Gopal, then I reset the simulator,deleted the derived data, removed the corresponding .pcm file(In my case it was the UIImage.h from UIKit framework, so removed the UIKit.pcm).Then I cleaned the project and only then I was able to build it successfully. In earlier versions of Xcode these files were locked basically and were not allowed to edit. But its not the case now. Hope this helps someone who face the same situation.
The only solution there worked for me was running the following command:
sudo rm -R /var/folders/
But that gave me a lot of troubles in OS X.
I thought because /var/folders/ is for temporary files it should be okay to just empty anything in it.
But I was wrong see the following post: link
And the problem you described occurred every-time I tried to build my Xcode project - I'm building it from the CLI though Jenkins.
Which means I couldn't run the rm command every-time. So I found some inspirations and wrote the following ruby script which solved my problem:
#!/usr/bin/env ruby
require 'fileutils'
cache = Dir.glob("/var/folders/**/com.apple.DeveloperTools*")
FileUtils.rm_rf(cache)
I hope it would be helpful to someone.
Deleting project.xcworkspace did a trick for me.
project.xcworkspace is a directory which describes schema of current Xcode workspace state. Each time Xcode is launched it will regenerate project.xcworkspace if not exist already.
In order to delete project.xcworkspace:
Right click on your project file yourProject.xcodeproj
From drop-down menu choose Show Package Content
Purge xcworkspace file
If you are building on command line using xcodebuild remove '-parallelizeTargets' option passed to the command. That fixed the issue for me
After going through a lot of answers and helpful suggestions, I found out the solution to be: Uninstall Xcode 6 and reinstall it through the available dmg file and then install all the components for Xcode.
Product + Option -> Clean Build Folder, Clean Build Project, Deleting Module Cache files and Derived data files, using touch .pch, deleting pcm file, using command line to remove var/folders (Surprisingly, all of this did not help in my case)
Was stuck at it for more than 3 hours before finding the solution. Hope this helps someone.
Thanks.
Just open terminal and fire below command:
rm /Users/pratik/Library/Developer/Xcode/DerivedData/ModuleCache/LKL48GNAN6S7/UIKit-2X95M2Q1NPNPL.pcm
give your file path which return .pcm error. and then Clean Project and Run...Enjoy!!!

Resources