Closed zeeshanmakeen closed 2 months ago
Hi @trinhngocthuyen any advice on this?
Hi there, sorry for the very late response. I took a look at this issue, and it turned out to be an issue in headers/modulemap detection. I've made the fix in #109. Thank you!
Thank you for the fix
Sorry for commenting on a closed issue but I think it's not enough to file a new one. I also use aws-crt-swift in my project, the defining line of the aws-crt-swift just like your Podfile, when I run the pod install, everything works fine but I come back to my Xcode and there is an error said that aws-crt-swift cannot resolve because the package is not found at the git url. After I manually resetting spm the aws-crt-swift is pulled without any issue. How can I fix this? @trinhngocthuyen @zeeshanmakeen
@Linkadi98 Hey there. It would be best if we had more info like:
I get this error all the time when I run pod install
Also, I get another error when trying to compile the flutter app ios with aws-crt-swift dependency from your plugin
This is so weird because I build the flutter app it never works, but when I switch to build natively (by Xcode) everything works smoothly
this is my Podfile
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
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)
plugin "cocoapods-spm"
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
spm_pkg "AmplifyUILiveness",
:url => "https://github.com/aws-amplify/amplify-ui-swift-liveness.git",
:branch => "main",
:products => ["FaceLiveness"]
spm_pkg "aws-crt-swift",
:git => "https://github.com/awslabs/aws-crt-swift.git",
:branch => "main",
:products => ["AwsCommonRuntimeKit"]
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
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['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
config.build_settings['HEADER_SEARCH_PATHS'] << "$(SOURCE_PACKAGE_CHECKOUT_DIR)/aws-crt-swift/aws-c-auth/include"
end
end
end
@trinhngocthuyen any idea on this? It's very hard to use spm with cocoapods but the tool has done alot of works. Maybe the issue comes from flutter ios build tool but I'm not sure about this.
@Linkadi98 Let's track this in a separate issue. Shall we?
@trinhngocthuyen I created a new track issue #122
What happened?
I am running this pod file:
Pod install
command is running fine. But when building the actual project, I am getting this error:It is not generating all the modulemap files. Specifically the moduel inside
aws-common-runtime
folder of the SPM package. This is happening with this spm package only. Am I missing something here?CocoaPods environment
Stack
Installation Source
Plugins
Podfile
Anything else?
No response