Closed aardrop closed 2 years ago
Hello @arkeri this issue seems to be related to https://github.com/aws-amplify/amplify-ios/issues/2001
Can you paste the content of the Podfile
under the ios
directory of your Flutter project?
Here is the contents of my podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '14.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
use_frameworks!
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
Hello @arkeri this issue seems to be related to aws-amplify/amplify-ios#2001
Can you paste the content of the
Podfile
under theios
directory of your Flutter project?
Following the discussion here, it allows us to run builds by changing ['BUILD_LIBRARY_FOR_DISTRIBUTION'] to 'NO', but it seems to be messing with our deployment pipeline. Is there a reason this is necessary, considering that for us, until yesterday Amplify didn't require this change?
Hi @arkeri did the build suddenly break or did you update xcode/amplify flutter dependencies beforehand?
I believe the reasons for that requirement are contained within the linked amplify ios issue:
@fjnoyp, No, for the past two months we had not had this issue at all with the same most recent version of flutter and the same version of amplify. My hypothesis is that a stable version of Amplify or a dependency of amplify was stored in DerivedData for a while after this issue first started so when that cleared it caused this issue to come to light from the new code but for us, it arrived out of nowhere.
Hi @arkeri - It is possible that something changed that is causing this to no longer be supported, but I don't believe it ever was intended to be supported in the first place. Is there a specific reason that you have set this in your Podfile? If there is a good use case for this, we can bring it to the Amplify-iOS team to be considered. Otherwise, the recommended fix is to remove this from the Podfile.
Hi @arkeri - I am going to close this out since there is a recommended fix for this. If you believe there is a good use case to support this, please open a new request. Thanks.
Description
Something in the swift files is causing XCode to throw this error:
I've cleaned everything and re-installed and updated pods many times at the point and nothing seems to work. Does anyone have any idea how to fix this?
Categories
Steps to Reproduce
MacOS: 12.5.1 XCode: 13.4.1 Flutter: 3.0.5 Amplify: 0.6.6
Screenshots
No response
Platforms
Android Device/Emulator API Level
No response
Environment
Dependencies
Device
iPhone simulator or on device
OS
MacOS: 12.5.1, iOS 15.2 and 15.5
Deployment Method
Custom Pipeline
CLI Version
No response
Additional Context
No response
Amplify Config
{ "auth": { "plugins": { "awsCognitoAuthPlugin": { "UserAgent": "aws-amplify-cli/0.1.0", "Version": "0.1.0", "IdentityManager": { "Default": {} }, "CredentialsProvider": { "CognitoIdentity": { "Default": { "PoolId": "", "Region": "" } } }, "CognitoUserPool": { "Default": { "PoolId": "", "AppClientId": "", "AppClientSecret": "", "Region": "" } }, "Auth": { "Default": { "authenticationFlowType": "USER_SRP_AUTH" } }, "PinpointAnalytics": { "Default": { "AppId": "", "Region": "" } }, "PinpointTargeting": { "Default": { "Region": "" } }, "S3TransferUtility": { "Default": { "Bucket": "", "Region": "" } } } } }, "analytics": { "plugins": { "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "", "region": "" }, "pinpointTargeting": { "region": "" } } } }, "storage": { "plugins": { "awsS3StoragePlugin": { "bucket": "", "region": "", "defaultAccessLevel": "guest" } } }, "api": { "plugins": { "awsAPIPlugin": { "outway": { "endpointType": "REST", "endpoint": "", "region": "", "authorizationType": "*****" } } } } }