flutter Xcode: fatal error: module 'admob_flutter' not found #import admob_flutter; - iphone

I am stuck with an Admob problem. I cannot display the application on the emulator. The app works great on Android.
This is the Runner/GeneratedPluginRegistrant.m:
This file is generated automatically.
What can I try to solve this issue?

This happens to me seemingly at random with whichever package iOS doesn't feel like cooperating with on a particular day.
This has worked for me in the past:
run flutter clean in terminal
run flutter pub get
navigate to iOS folder cd ios
run pod install
Sometimes that does it by itself.
Other times I find I've had to delete the entire iOS folder then have recreate it with
flutter create .
Then sometimes I would re-create the folder then do all the first steps again before I can build successfully.
If you do that and have Firebase in your app, keep in mind you'll have to re-add your GoogleService-Info.plist file via X-Code.

Related

Flutter Could not build the application for the simulator. Error launching application on iPhone 14

I use flutter and it was working fine without any problem and suddenly this came out of nowhere "Could not build the application for the simulator. Error launching application on iPhone 14." and it happened to my friend too who work on the same project
Note we are using Mac
I tried flutter clean and run it again
pod update and also I delete the iOS folder and I put back my runner folder ...
I even start all over new Project and firebase
I solved this problem by doing a new flutter project and paste all the lab folder files one by one on it
Deleted the new iOS folder and also paste my old one instead
then in the terminal
flutter pub cache repair
flutter update
and it worked 👍🏼

No podspec found for `flutter_user_agentx` in `.symlinks/plugins/flutter_user_agentx/ios`, while running application on ios. Android is working

I am trying to run my flutter application in ios, and while pod installs I am getting an error ([!] No podspec found for flutter_user_agentx in .symlinks/plugins/flutter_user_agentx/ios). I am using a dependency named "flutter_user_agentx", On android is working fine, a Few days back it was working fine for ios also but today I am getting this error.
I want to run my flutter application on ios.
This usually happens when you add a new package and there are no pods for ios for that package. However, you will get a lot of pods problem, but mostly following these steps will solve them:
run flutter clean
Delete the following files in the ios folder: Podfile and Podfile.lock and the folder Pods
run flutter pub get
go to the 'ios' folder using cd ios
run pod install --repo-update (to install the pods again, and if u face any problem try without --repo-update)
Run your app, from command line using 'flutter run' which will take a little bit longer
It seems that package is broken in iOS.It's a fork of the original repo. Not the official one.
Use the below package instead.
https://pub.dev/packages/fk_user_agent
GitHub issue link

Flutter: When I debug my App, my App creates this files

My App have a Problem so I Need to do flutter clean before I can debug my app.
So I do flutter clean and after that flutter run in my Terminal.
Then my App debug. After that flutter creates a new build folder, new .flutter-plugins and .flutter-plugins-dependencies.
Now I think the problem is not there but sometimes it creates the files.
Can I delete the files? And how can I fix it?
PS: I have the newest version of flutter and Xcode. And I work with VSCode and I work on a MacBook with the newest Version.
I'm not sure about this, but in one case I tried adding resource permission from info.plist(I messed with internal storage permission), I noticed similar behaviour.

Flutter ios release build cannot find snapshot

While trying to build flutter ios app for release I am getting this error every time
Failed to find snapshot: /var/containers/Bundle/Application/19D78607-A03B/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin
I have tried these things to correct it but failed
running flutter clean and then flutter run --release
changing flutter channel to beta and master
deleting build folder and then flutter clean and flutter run --release
flutter clean > flutter build ios > archive in Xcode to test on the test flight
Does anyone know how to fix it?
I've been seeing this issue frequently over the last few days. I recreated my ios directory which fixed the issue temporarily, but it came back.
What I learned is that it is expected that kernel_blob.bin is not present in release builds, because that file contains your Dart sources in bytecode form ready for JIT, but release builds don't use JIT, they use AOT and your Dart files are compiled into a binary that is placed under App.framework. Rather, this error happens because the release build of the app is incorrectly incorporating the debug (i.e. JIT) version of the Flutter engine.
The best solution I've found so far is to move the build folder to the trash (flutter clean is not working and hangs indefinitely on deleting the build folder for some reason), run flutter clean, run flutter build ios --release from the command line first, then (in my case) create the archive in Xcode.
Run flutter doctor -v
I have resolved this problem, if someone happened, you can try this.
Remove Flutter.framework, build again. Make sure Flutter.framework and App.framework are the same debug or release mode.
Run the following from a terminal, this removes "ios/Flutter/App.framework" and everything underneath it:
rm -rf ios/Flutter/App.framework
and then rebuild your app from xCode. This solved this problem for me.

Error while uploading Flutter App to App Store: Non-public API usage

I am new in Flutter Development and i have developed an app with Webview.
I have upload an apk on Google Play Store that is accepted but for App Store it shows some error.
Please find below error,
ITMS-90338: Non-public API usage - The app references non-public
symbols in Frameworks/Flutter.framework/Flutter: _ptrace. If method
names in your source code match the private Apple APIs listed above,
altering your method names will help prevent this app from being
flagged in future submissions. In addition, note that one or more of
the above APIs may be located in a static library that was included
with your app. If so, they must be removed.
For this error i have search many things but i am unable found any solution for this.
So please any one who is capable of solving this please help me to resolve this.
Thanks & Regards,
This happens if you are submitting the debug version to the AppStore, Flutter team recommends you to first run
flutter build ios --release
before archiving your app in Xcode.
First make sure you are submitting a release build with flutter build ios --release
If that's not the problem here you could find similar problems related:
flutter build ios --release may use a debug Flutter.framework by mistake
In my case, I updated my Mac to 10.15(Catalina), while the update my cocoapods installation wasn't there. So whenever I try to upload using the command flutter build ios --release and archiving it. Apple sent me the same email you received.
You can install cocoapods using the following commands.
step 1 Open terminal
step 2 command: sudo gem install cocoapods
step 3 set your project path on the terminal.
step 4 command: pod init
I hope it helps.