Open rensamatar opened 1 year ago
@rensamatar Thank you for reaching out do you mind posting your podfile?
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
$FirebaseAnalyticsWithoutAdIdSupport = true
# Ignore all warnings from all pods.
inhibit_all_warnings!
# 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)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# Pods for Runner
pod 'Lokalise', '~> 0.10.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
# Add the following:
target.build_configurations.each do |build_configuration|
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
build_configuration.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
build_configuration.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
target 'OneSignalNotificationServiceExtension' do
use_frameworks!
pod 'OneSignalXCFramework', '>= 3.4.3', '< 4.0'
end
Here is my Podfile @emawby
@rensamatar You mentioned it working in Xcode but not VSCode, I wonder if your xcodebuild tools version is different than your Xcode version? E.g. it is using Xcode 13 build tools for command line (vscode) builds. If you do flutter run via a CLI does it work?
# Uncomment this line to define a global platform for your project platform :ios, '12.0' $FirebaseAnalyticsWithoutAdIdSupport = true # Ignore all warnings from all pods. inhibit_all_warnings! # 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) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) # Pods for Runner pod 'Lokalise', '~> 0.10.0' end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) # Add the following: target.build_configurations.each do |build_configuration| build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' build_configuration.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' build_configuration.build_settings['ENABLE_BITCODE'] = 'NO' end end end target 'OneSignalNotificationServiceExtension' do use_frameworks! pod 'OneSignalXCFramework', '>= 3.4.3', '< 4.0' end
Lexical or Preprocessor Issue (Xcode): 'OneSignal/OneSignal.h' file not found /Users/anmolgupta/StudioProjects/balizaprojects/secupark-mobile/ios/SecuparkMobile/NotificationService.m:0:8
Could not build the application for the simulator. Error launching application on iPhone 12 Pro.
same issue.. Any possible solution??
I'm having the same issue. Been stuck on this for days now. My Podfile:
`# Uncomment this line to define a global platform for your project platform :ios, '11.0'
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)
flutter_ios_podfile_setup
target 'Runner' do use_frameworks! use_modular_headers!
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) end end
target 'OneSignalNotificationServiceExtension' do use_frameworks! pod 'OneSignalXCFramework', '>= 3.4.3', '< 4.0' end`
I got the same error and when I checked out the documentation, it seems like there's a minor change to the NotificationService.m
file (see 3.10).
The specific changes:
After I amended the changes, it worked fine. Maybe OneSignal needs to update the migration guide.
Hi @akifarhan I updated the pubspec.yaml to onesignal_flutter: ^5.0.3
and follow the migration guide by update the Podfile
target 'OneSignalNotificationServiceExtension' do
use_frameworks!
pod 'OneSignalXCFramework', '>= 5.0.2', '< 6.0.0'
end
and run $cd ios/ $rm -rf PodFile.lock Pods $pod install $pod update
Also update the NotificationService.m with
#import <OneSignalFramework/OneSignalFramework.h>
but error still exist.
Hi @akifarhan I updated the pubspec.yaml to
onesignal_flutter: ^5.0.3
and follow the migration guide by update the Podfiletarget 'OneSignalNotificationServiceExtension' do use_frameworks! pod 'OneSignalXCFramework', '>= 5.0.2', '< 6.0.0' end
and run $cd ios/ $rm -rf PodFile.lock Pods $pod install $pod update
Also update the NotificationService.m with
#import <OneSignalFramework/OneSignalFramework.h>
but error still exist.
![]()
i have the same issue any solution for this problem?
Still facing the issue. Lexical or Preprocessor Issue (Xcode): 'OneSignal/OneSignal.h' file not found /Users/mrmacbook/.pub-cache/hosted/pub.dev/onesignal_flutter-3.5.1/ios/Classes/OSFlutterTagsController.m:28:8
What i have already tried:
I have the same problem and have not found a solution
How can we help?
How do I solve the issue for missing file.
flutter clean
doesn't helprm -rf Podfile.lock Pods && pod install --repo-update
doesn't helpEnv:
Code of Conduct