OneSignal-iOS-SDK icon indicating copy to clipboard operation
OneSignal-iOS-SDK copied to clipboard

[question]: Need help with cocoapods integration

Open Sergozh opened this issue 2 years ago • 14 comments

How can we help?

I have pods file like this:

target 'Main iOS App' do
    pod 'OneSignalXCFramework', '>= 3.0.0', '< 4.0'

  target 'OneSignalNotificationServiceExtension' do
    use_frameworks!
    pod 'OneSignalXCFramework/OneSignalExtension', '>= 3.0.0', '< 4.0'
  end

    pod 'Moya'
    pod 'KeychainAccess'
    pod 'Firebase/Crashlytics'
    pod 'Firebase/RemoteConfig'
    pod 'Amplitude', '~> 8.0'
    pod 'Firebase/Analytics'
end

And I meet issue when all pods where integrated onto nested OneSignalNotificationServiceExtension target. Could you help to resolve this issue?

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Sergozh avatar May 21 '22 14:05 Sergozh

@Sergozh Could you provide the error or exact issue you are seeing? Please also share your the full contains of your Podfile and Podfile.lock files.

One suggestion is you may need to move use_frameworks! to the main target.

jkasten2 avatar May 21 '22 20:05 jkasten2

Sure I'll create test project to show issue

Sergozh avatar May 23 '22 08:05 Sergozh

Here is my test environment: Project

Sergozh avatar May 23 '22 15:05 Sergozh

Update project link

Sergozh avatar May 25 '22 08:05 Sergozh

@Sergozh I am getting errors in that project even after removing all OneSignal references, however I see what you mean where by nesting the targets the Notification Service Extension now also depends on all of the pods in your app target. You can try removing all of the dependencies from the Pods-OneSignalNotificationServiceExtension framework except for OneSignalXCFramework image

emawby avatar May 31 '22 18:05 emawby

@emawby I'll try ASAP. Thanks for your advice!

Sergozh avatar Jun 01 '22 08:06 Sergozh

@emawby unfortunately having the same error after removing all dependencies except OneSignalXCFramework. Could I revert to previous structure of pod file without nesting or not after update 3.11.0?

Sergozh avatar Jun 02 '22 16:06 Sergozh

@Sergozh You can yes, but don't use the OneSignalExtension submodule just use the OneSignalXCFramework in both the podfile and code

emawby avatar Jun 02 '22 17:06 emawby

Thank you! Hope we can find better solution than nesting targets and removing dependencies manually from Xcode

Sergozh avatar Jun 02 '22 17:06 Sergozh

i have also faced the same issue thats in release 3.11.1 thats the issue in pod release. i have solved the issue by downgrading the pod for onesignal pod 'OneSignal', '= 3.10.2' and changing code related to pod version 3.10.2.

umarfarooqitgcuf avatar Jun 03 '22 13:06 umarfarooqitgcuf

Hi @umarfarooqitgcuf Last several months not resolve this issue. But now i have successfully done this issue. I appreciate your effort.

ansafdev avatar Jun 04 '22 04:06 ansafdev

Also facing the same issue.

vinczebalazs avatar Aug 08 '22 07:08 vinczebalazs

Also facing the same issue.

Please install the pod with specific version pod 'OneSignal', '= 3.10.2'. It will be helpful for you. thanks

ansafdev avatar Aug 08 '22 13:08 ansafdev

pod 'OneSignal', '= 3.10.2' not working for me. My other pods doing error when I added to extension

yunustek avatar Aug 26 '22 13:08 yunustek