0

My apologies if the title of the question isn't clear enough, here is a better explanation of the problem I am facing, so I am trying to write a shell script to run on app center to deploy my application for tests/production. the script is as follows

#!/usr/bin/env bash

# fail if any command fails
set -e
# debug log
set -x

cd ..
git clone -b beta https://github.com/flutter/flutter.git
export PATH=$(pwd)/flutter/bin:$PATH
flutter channel stable

flutter upgrade
flutter doctor
flutter clean
rm -f ios/Podfile.lock pubspec.lock
rm -rf ios/Pods ios/Runner.xcworkspace
flutter build ios --release --no-codesign

nothing much going around here, first of all, I install flutter then set the path to it, make sure flutter is installed correctly, then clean up (just an extra thing I am doing) then remove the old podfile, public.lock pods and the runner.xcworkspace the reason is to make sure that every time I want to generate a brand new file for the build, anyways, running the script will fail and result in the following error message

lib/pages/reset_password_page.dart:24:62: Error: 'InputWidgetState' isn't a type.
  final GlobalKey<InputWidgetState> _phoneNumKey = GlobalKey<InputWidgetState>();
                                                             ^^^^^^^^^^^^^^^^
Failed to package /Users/muhammad/Desktop/test/OrbitFoodCustomerApp.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/muhammad/Desktop/test/OrbitFoodCustomerApp/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'libPhoneNumber-iOS' from project 'Pods')

the error message is longer than that but it is kind of repertative and that's the most important part. the really weird part for me is when I modify the script in the following way

#!/usr/bin/env bash
#Place this script in project/ios/
# fail if any command fails
set -e
# debug log
set -x
cd ..
# git clone -b beta https://github.com/flutter/flutter.git
# export PATH=$(pwd)/flutter/bin:$PATH
flutter channel stable
flutter upgrade
flutter doctor
flutter clean
rm -f ios/Podfile.lock pubspec.lock
rm -rf ios/Pods ios/Runner.xcworkspace
flutter build ios --release --no-codesign

note that the export path is commented out so this time the script will use the flutter installed on my machine, the script succeeds in building the app which I find very weird, I checked the flutter version of both flutters (the newly downloaded and the one on my machine) and they are exactly the same. same branch same version the same everything. but for some reason using my own flutter succeeds while using the downloaded flutter fails.

please note that both the scripts are being run on my own machine, the only difference is that I am specifying the flutter path in one script and I use my previously installed flutter in the other one, and I made sure to specify that targeted deployment ios version to be 12 anywhere possible.

any idea what's going on?! I am very confused. thank you in advance.

MoTahir
  • 863
  • 7
  • 22

0 Answers0