Encountered error while building for device - flutter
Jimmy Anderson after running flutter upgrade
, with the existing project you need to check the dependencies
used if they are up to date too.
I had the same error with version 1.20.1
and the solution was to delete the Pods
folder, the pubspec.lock
file:
): Clean completely all points to links:
flutter cleanrm -Rf ios/Podsrm -Rf ios/.symlinksrm -Rf ios/Flutter/Flutter.frameworkrm -Rf ios/Flutter/Flutter.podspec
): Finally run these:
rm ios/Podfilerm pubspec.lockflutter run
If anyone has an up-to-date answer can complete this temporary solution.
These steps helped me to resolve a similar issue
- At first try to take an Android build by following these steps
- Delete
pubspec.lock
file flutter clean
( inside ur project directory )flutter pub get
flutter build apk --release
I then saw my Android build fail, it was some dependency related issues and I fixed those. Then repeated the above step 1. After that my Android build was successful.
- Then try to take the iOS build by following these steps
- Deleted
Pods
folder inside theios
directory - Deleted the
Podfile.lock
file inside theios
directory cd ios
pod install
pod update
cd ..
flutter clean
flutter pub get
flutter build ios --release
And then my iOS build was successfull