Closed Surya-thangavel closed 3 years ago
Hi @Surya-thangavel can you please verify the deployment target of your app? This is a known issue when targeting older versions of iOS. Amplify requires this value to be iOS 11.0 or later (13.0 or later when using DataStore).
@dnys1 The targeting version is iOS 11.0 as I am not using DataStore.
Hi @Surya-thangavel can you provide the logs file again as I cannot open it.
i think not only the main target version need to over ios11, but all other target in the xcodewordspace need to over ios11
Hi @jsw-davidhuang , can you please elaborate a bit more? I am also having the same problem and all of my Deployment Targets are 13.0. Thank you.
@fjnoyp Here's the log file flutter build ios log.txt
@benedict1986 The app running on simulator and build succeed with amplify but only when archiving the app this error occurs, Is yours the same issue ?
Hi @jsw-davidhuang , can you please elaborate a bit more? I am also having the same problem and all of my Deployment Targets are 13.0. Thank you.
i think is something like this, this pod all need to be over ios 11
Hi @Surya-thangavel are you sure you are targeting 13.0? In the logs file provided I see the following messages at the end:
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 14.5.99. (in target 'FMDB' from project 'Pods')
Thanks @jsw-davidhuang for your help clarifying how to set the main target version.
@Surya-thangavel @benedict1986 does following his advice help resolve your problem?
Hi @Surya-thangavel I've been trying to reproduce your error but I am able to archive the amplify_auth_cognito example app no problem. Here is my setup:
Xcode 12.2
My Runner and Pods -> General tab -> Deployment Info are all set to iOS 11.0 as shown in the picture attached (just like jsw-davidhuang recommended)
In the logs you sent me, it appears you are still set to 8.0. I'm not able to target that version. What version of Xcode are you using?
by the way, if still can not set to ios11, you should directly edit the .spec file in the pods folder, it is something like .symxxxx/packagename.podspec
@benedict1986 The app running on simulator and build succeed with amplify but only when archiving the app this error occurs, Is yours the same issue ?
Hi @Surya-thangavel , I am not sure what do you mean by archiving. I can run my app in simulator but when I run it with my iPhone, I got this error.
When I run flutter run
in command line with my iPhone connected, I got the following error
Hi @jsw-davidhuang , can you please elaborate a bit more? I am also having the same problem and all of my Deployment Targets are 13.0. Thank you.
i think is something like this, this pod all need to be over ios 11
Hi @jsw-davidhuang , I think I don't have this Pods project
@benedict1986 did you open the Runner.xcworkspace project? Your error message mentions that you should open that project. I think you might have opened the Runner.xcodeproj on accident instead.
@benedict1986 did you open the Runner.xcworkspace project? Your error message mentions that you should open that project. I think you might have opened the Runner.xcodeproj on accident instead.
Hi @fjnoyp , after investigating a bit, I found the issue when I run flutter run
is that I did not build in release mode. I added --release to the command and eventually got the following error, which was the same as what I got from Xcode.
Hi @fjnoyp , I finally get my log as well but could not find any message similar as the one you pointed out for @Surya-thangavel.
Build target Runner_2021-09-21T00-48-54.txt
This is something about IPHONEOS_DEPLOYMENT_TARGET
Can you also please help to have a look and see if there is anything you can identify? Thanks a lot.
The following steps allow me to create a release archive. If someone can create a minimum set of steps to reproduce this issue, I will reopen. Otherwise, I believe this is resolved.
amplify_flutter
and amplify_auth_cognito
as dependencies.Podfile
to have platform :ios, '11.0'
.pod install
inside ios
directory to generate Runner.xcworkspace
.ios/Runner.xcworkspace
and change deployment target to iOS 11.flutter build ios
to create a release build.ios/Runner.xcworkspace
and run Product > Archive
.Hi @dnys1 , thank you for your step. My case is slightly different from yours. I already have Cognito setup in AWS and do not want to initialise Amplify with Auth category. I only want to use the library to use Cognito. Here is the minimum steps I am using to recreate the issue. Can you please let me know if there is any missing steps or anything wrong with it. I am happy to share myapp4 if you need it. Thank you.
flutter create myapp4
add amplify_auth_cognito: ^0.2.4 to pubspec.yaml
run flutter pub get
double click Runner.xcworkspace in ios folder and open the project in Xcode
update iOS Deployment Target to 11.0
Hook up IPHONE
use personal team to sign the app, I changed the bundle identifier to com.example.myapp4-1024
make sure Runner > iPhone is selected
click the arrow to run the app
=================================================== Here is the result of flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale en-AU) • Flutter version 2.2.3 at /Users/admin/Desktop/flutter • Framework revision f4abaa0735 (3 months ago), 2021-07-01 12:46:11 -0700 • Engine revision 241c87ad80 • Dart version 2.13.4
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
flutter config --android-sdk
to update to that location.
[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.5.1, Build version 12E507 • CocoaPods version 1.11.2
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] Connected device (2 available) • iPhone (mobile) • 00008030-0003385122EA802E • ios • iOS 14.3 • Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
! Doctor found issues in 2 categories.
Hi @benedict1986, you are missing a couple steps. Please follow steps 3-4 from my post and try again.
Hi @benedict1986 i think when you build you got to better do like this:
1. flutter clean
2. flutter build ios
3. 3.open the xworkspace in the ios folder then build .
4. but all this require the 0 step which is : you need to amplify init the project and input the keys you apply on aws cognito.
Hi @dnys1 and @jsw-davidhuang , thank you for you advice.
According to @dnys1 , I ran pod init, update Podfile and pod install as follow
Unfortunately, the error is still there. I trust your approach works. It means the only thing I did not try was to run amplify init with Auth category.
The reason I reluctant to run amplify init
is because it provisions the backend in aws. It creates a new IAM user and something else. I don't know what exactly it's created so I want to use the existing aws profile (client id and client secret) instead of using amplify init to create another one.
Not sure if @Surya-thangavel has solved the problem or not.
Thanks for all of your help. Let me try to understand more about the library.
@benedict1986 Can you verify you are opening Runner.xcworkspace
and not Runner.xcodeproj
. The image above showed the latter.
Running amplify init
is not technically required for building a release archive, so I don't believe that's the problem.
Hi @dnys1, thank you for your advice. in the previous post with lots of images. I did not init and install pod. As a result there is no Pods project when I open Runner.xcworkspace
. Now I init and install pod, I can see the Pods project when I open Runner.xcworkspace
as follow
In order to make sure I did not open a wrong file. I renamed the original Runner.xcworkspace
to Runner2.xcworkspace
and another Runner.xcworkspace
is generated when I run pod install
. And I pretty sure I opened the newly generated Runner.xcworkspace
and then I see the Xcode as the image above.
Unfortunately, even doing that, I still get the same error about amplify_auth_cognito module not found.
Ok, finally, it's working...I summary the steps as follow:
flutter create myapp
pubspec.yaml
and add amplify_auth_cognito: ^0.2.4
flutter pub get
. This step is what I am missing. After running this step, I saw the Podfile. Previously I did not run this step and create the Podfile with pod init
, which is not rightPodfile
and uncomment platform :ios, '9.0'
and update it to platform :ios, '11.0'
pod install
Runner.xcworkspace
flutter build ios
to create a release build. I have a automatic signing issue in this step but I think it should be easy to resolve.Massive thank to @fjnoyp and @dnys1
Thank you for the update @benedict1986. I'm glad you were able to get it resolved 👍
This is happening to me on macos flutter 3.24 and latest amplify_auth_cognito
Im facing the same issue with flutter 3.2.24 and the following versions:
amplify_flutter: ^2.4.1 amplify_auth_cognito: ^2.4.1 amplify_authenticator: ^2.1.3
Parse Issue (Xcode): Module 'amplify_auth_cognito' not found
When i run it via xCode it seems to work, but via the CLI or VsCode the package is not found.
`flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 24A335 darwin-arm64, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.93.1)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!`
Description: Build succeeds in Xcode run and also runs fine in Simulator, But When Archiving the runner
Error : "Parse Issue Module 'amplify_auth_cognito' not found"
Flutter doctor Output
`[✓] Flutter (Channel stable, 2.0.6, on macOS 11.5.2 20G95 darwin-x64, locale en-GB) • Flutter version 2.0.6 at /Users/srinivashvk/flutter • Framework revision 1d9032c7e1 (5 months ago), 2021-04-29 17:37:58 -0700 • Engine revision 05e680e202 • Dart version 2.12.3
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/srinivashvk/Library/Android/sdk • Platform android-31, build-tools 31.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.5.1, Build version 12E507 • CocoaPods version 1.11.1
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] VS Code (version 1.60.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.26.0
[✓] Connected device (2 available) • iPhone 11 (mobile) • A490CC7A-78F1-4A2F-9325-4E1047F49EB0 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator) • Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.63
• No issues found!`
Flutter build ios full log log (1).txt