OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
623 stars 213 forks source link

[Bug]: error while installing the pods #965

Open gauravRNDev opened 4 weeks ago

gauravRNDev commented 4 weeks ago

What happened?

when i try to install latest version of oneSIgnal SDK the pod install is not working on ios the

Steps to reproduce?

Xcode version:- 16
Mac OS - 14.5
Cocoapods :- 1.15.2
flutter version 3.42.4 and dart :- 3.5.3

install oneSignal_flutter sdk
follow all the steps provided in the one signal flutter 
pod install giving me this error

What did you expect to happen?

I expected it to install easily as I used one signal for many items in react native and this is my first time using one signal with Flutter

OneSignal Flutter SDK version

Release 5.2.6

Which platform(s) are affected?

Relevant log output

### Command

/Users/apple/.rvm/gems/ruby-2.7.6/bin/pod install

Report

Stack

   CocoaPods : 1.15.2
        Ruby : ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-darwin22]
    RubyGems : 3.4.9
        Host : macOS 14.5 (23F79)
       Xcode : 16.0 (16A242d)
         Git : git version 2.40.0
Ruby lib dir : /Users/apple/.rvm/rubies/ruby-2.7.6/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

Uncomment this line to define a global platform for your project

platform :ios, '13.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)

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', '>= 5.0.0', '< 6.0' end


### Error

RuntimeError - PBXGroup attempted to initialize an object with unknown ISA PBXFileSystemSynchronizedRootGroup from attributes: {"isa"=>"PBXFileSystemSynchronizedRootGroup", "exceptions"=>["18DD18082CCA1C6900C04461"], "explicitFileTypes"=>{}, "explicitFolders"=>[], "path"=>"OneSignalNotificationServiceExtension", "sourceTree"=>"<group>"} If this ISA was generated by Xcode please file an issue: https://github.com/CocoaPods/Xcodeproj/issues/new /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:359:in rescue in object_with_uuid' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:349:inobject_with_uuid' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:300:in block (2 levels) in configure_with_plist' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:299:ineach' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:299:in block in configure_with_plist' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:296:ineach' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:296:in configure_with_plist' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project.rb:272:innew_from_plist' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:350:in object_with_uuid' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:290:inblock in configure_with_plist' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:287:in each' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:287:inconfigure_with_plist' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project.rb:272:in new_from_plist' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project.rb:213:ininitialize_from_file' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project.rb:113:in open' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:1194:inblock (2 levels) in inspect_targets_to_integrate' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:1193:in each' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:1193:inblock in inspect_targets_to_integrate' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in section' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:1188:ininspect_targets_to_integrate' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:107:in analyze' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:422:inanalyze' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:244:in block in resolve_dependencies' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:insection' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:243:in resolve_dependencies' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:162:ininstall!' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in run' /Users/apple/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:334:inrun' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in run' /Users/apple/.rvm/gems/ruby-2.7.6/gems/cocoapods-1.15.2/bin/pod:55:in<top (required)>' /Users/apple/.rvm/gems/ruby-2.7.6/bin/pod:25:in load' /Users/apple/.rvm/gems/ruby-2.7.6/bin/pod:25:in

' /Users/apple/.rvm/gems/ruby-2.7.6/bin/ruby_executable_hooks:22:in eval' /Users/apple/.rvm/gems/ruby-2.7.6/bin/ruby_executable_hooks:22:in
'


――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%60PBXGroup%60+attempted+to+initialize+an+object+with+unknown+ISA+%60PBXFileSystemSynchronizedRootGroup%60+from+attributes%3A+%60%7B%22isa%22%3D%3E%22PBXFileSystemSynchronizedRootGroup%22%2C+%22exceptions%22%3D%3E%5B%2218DD18082CCA1C6900C04461%22%5D%2C+%22explicitFileTypes%22%3D%3E%7B%7D%2C+%22explicitFolders%22%3D%3E%5B%5D%2C+%22path%22%3D%3E%22OneSignalNotificationServiceExtension%22%2C+%22sourceTree%22%3D%3E%22%3Cgroup%3E%22%7D%60%0AIf+this+ISA+was+generated+by+Xcode+please+file+an+issue%3A+https%3A%2F%2Fgithub.com%2FCocoaPods%2FXcodeproj%2Fissues%2Fnew&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
gauravRNDev commented 4 weeks ago

if anyone comes across this issue then please downgrade your Xcode version to 15 in my case I downgrade to 15.3 and still, there will be one more error for which you should refer to this thread and all your builds and testing will work as expected. https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/857#issuecomment-2106324671

BisoDevil commented 4 weeks ago

if anyone comes across this issue then please downgrade your Xcode version to 15 in my case I downgrade to 15.3 and still, there will be one more error for which you should refer to this thread and all your builds and testing will work as expected. #857 (comment)

not worked

gauravRNDev commented 4 weeks ago

if anyone comes across this issue then please downgrade your Xcode version to 15 in my case I downgrade to 15.3 and still, there will be one more error for which you should refer to this thread and all your builds and testing will work as expected. #857 (comment)

not worked

update your pods according to your new xcode version if you downgrade your xcode

ArslanAsghar123 commented 2 weeks ago

I am able to resolve this issue as the error I am facing is almost similar to yours (LoadError—can not load such file -- ffi_c). It generally occurs because the ffi (Foreign Function Interface) gem, which CocoaPods requires, is either missing or incompatible with your current Ruby and macOS versions.

I run these commands respectively

sudo gem uninstall ffi sudo gem install ffi brew install rbenv pod update pod install

NOTE: remember to delete podfile.lock pod update before

Screenshot 2024-11-04 at 6 07 08 PM
cyrilcolinet commented 1 week ago

Hi here, the best solution is to upgrade xcodeproj to latest and cocoapods to latest. You'll be able to solve this issue with https://github.com/flutter/flutter/issues/157761#issuecomment-2443646840