Flutter - reinstalling App causes build to crash - flutter

I'm working on an app idea and ran into an issue with shared_preferences. After trying out a couple of things I stumbled on a post on stackoverflow to delete the app and reinstalling it again. After uninstalling the app I tried to run
$ flutter run
again but it doesn't build.
Launching lib/main.dart on iPhone 13 mini in debug mode...
Running pod install... 937ms
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `shared_preferences_ios` from `.symlinks/plugins/shared_preferences_ios/ios`
Resolving dependencies of `Podfile`
I tried to clean the installation:
rm ios/Podfile
flutter pub upgrade
flutter pub run
cd ios
pod init
pod update
flutter clean && flutter run
on flutter pub run the script runs to another error: pub finished with exit code 64
On the app I have custom fonts, and images from the assets folder enabled. The only dependency I'm using is shared_preferences: ^2.0.12
I pasted the full log here: https://pastebin.com/5XyDT0PT
edit:
I tried to reinstall cocoapods but still get the same error message:
$ brew upgrade ruby
$ gem uninstall cocoapods
$ gem install cocoapods
anyone having simular issues?

I've had this error too. Learn to look at the error log outputs. I believe you need this command
gem install ffi
see here for more details:
How to resolve LoadError: cannot load such file -- ffi_c

Related

FirebaseAppPlatform.verifyExtends error while running flutter test

When I run my bitbucket pipeline for my project im getting an error during flutter test:
/root/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/firebase_app.dart:18:25: Error: Member not found: 'FirebaseAppPlatform.verifyExtends'.
FirebaseAppPlatform.verifyExtends(_delegate);
^^^^^^^^^^^^^
When I run flutter test in my terminal I don't have these issues.
My pipeline script is:
Build Setup
flutter clean
flutter pub get
flutter pub run build_runner build
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)
flutter test
Because there are some breaking change of firebase_core_platform_interface that do not comply with semantic versioning:
https://github.com/firebase/flutterfire/issues/9806
You need to overwrite this library:
Root cause
You are update or installing only a subset of the Firebase plugins (firebase_core, firebase_analytics,...)
Solution
Solution 1: (preferred) Updating to the latest version with flutterfire update check the docs here. But it is not easily because your project will have a lot of packages dependencies to each other like flutter version 2 or 3, so on. Anyway, it is long term solution.
Solution 2: (Fix to run)
You can add to your pubspec.yaml
dependency_overrides:
firebase_core_platform_interface: 4.5.1
Solution 3: (Fix to run)
Update dependencies with this below command line:
flutter pub upgrade --major-versions
Finally, Run the project again by following stuffs:
flutter clean
flutter pub get
cd ios && rm -f Podfile.lock
cd ios && pod install --repo-update
flutter run
That's it!
Run "flutter pub upgrade --major-versions"
run this
flutter pub upgrade --major-versions
than run this
flutter upgrade
I changed my flutter version via flutter channel master. This changed automatically my pubspec.lock.
In my case, restoring previous version of pubspec.lock solved the problem (pug get needed).

Error running pod install (Flutter android studio)

im having trouble building my flutter project on my mac M1. When i try launching it in android studio im getting the error code 'error running pod install' and when i try opening it in xcode im getting 'module cloud_firestore not found'.
I have tried all the solutions in this thread How to solve "error running pod install" in flutter on mac? but nothing seems to work.
Im having no troble building flutter project without any dependencies but as soon as i add one im getting the error messages mentioned above, any ideas on how i could solve this?
I came to this problem as well (Macbook Air M1). I also tried the solution on your mentioned link but failed. However, finally I could solve the problem by following the steps on 'Deploy to iOS Device'
https://docs.flutter.dev/get-started/install/macos#install-xcode
Run this code on Terminal
$ sudo gem install cocoapods
$ sudo gem install ffi -- --enable-libffi-alloc
Restart Android Studio

How to fix an error that is occurred when install the pod in Flutter

I'm using the rwa_deep_ar package for the DeepAR feature in the Flutter project.
When I install the pod in MacOS, I see the following error.
I want to know how to fix this error and how to use the DeepAR for iOS in Flutter.
Kill the app
Run: flutter clean
Run: flutter pub get
Run: cd ios && pod install --repo-update
Podfile change platform :ios, '13.0' target set
Delete the folder and file from the project iOS folder
.symlinks folder
Pods folder
Podfile.lock file
flutter clean
flutter pub get
cd ios
pod install --repo-update

Flutter Stopped building for IOS --Error running pod install

Everything was working just fine and all of sudden this happned. I tried following
Uninstall Cocoapods
Install again Update
delete pod.lock file
upgrade ruby upgrade gem
nothing worked. I tried running other projects too but as soon as I add firebase dependencies I get this error..here
Analyzing dependencies
firebase_auth: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
[!] Failed to load 'firebase_auth' podspec:
[!] Invalid `firebase_auth.podspec` file: undefined method `ui' for #<Pod::Specification
name="firebase_auth">.
/ios/.symlinks/plugins/firebase_auth/ios/firebase_auth.podspec:24
# -------------------------------------------
# s.description = pubspec['description']
> s.ui.homepage = pubspec['ui.homepage']
# s.license = { :file => '../LICENSE' }
# -------------------------------------------
Error running pod install
It was an issue of Android studio really. I deleted my project, cloned it from github again and then used Flutter commands in temrinal to run the app on IOS it worked. If I try to run it using android studio it fails still with the same error.

Flutter Xcode build failed due to missing dependencies even when those have been deleted from pubspec.yalm

When I add a dependency to the pubspec.yaml file no matter if the IDE runs the pub get command or if I run it manually, it seems like the packages are being imported correctly (or that is what I think), however, if I "change my mind" and delete the package from the pubspec.yaml file, and again pub get, I am unable to build the app anymore, seems like the packages are still linked somehow to the app, even when there is no code related to them, the only way I can get back to work is by cleaning up all... e.g.
cd ios
cd ..
pod deintegrate
flutter clean
flutter pub cache repair
flutter pub get
cd ios
Pod install
Pod repo update
Maybe I am missing a step when working with dependencies.