OneSignal / OneSignal-iOS-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
494 stars 262 forks source link

[Bug]: Onesignal 5.1.5, 5.1.6 could not be resolved in iOS Swift Package Manager #1424

Closed jenbitcoin closed 4 months ago

jenbitcoin commented 5 months ago

What happened?

We are currently using this version 3.12.9 -- and wanted to updated our package. The latest ones I saw today were 5.1.5, and 5.1.6. The thing is that it could not be resolved. And I get some errors on checksum not matched and fatalError.

I tried Resolving SPM, I tried clearing cache, removed derived data (clean out trash), restart xcode. And lastly, I tried removing OneSignal from our SPM. Build the project. Re-add OneSignal to our SPM which automatically points to latest version. But it still doesn't work. Screenshot 2024-05-02 at 3 23 16 PM Screenshot 2024-05-02 at 3 23 31 PM

But if I revert back to OneSignal 3.12.9, everything works out well, and I can build the project again successfully:

Steps to reproduce?

1. Just by updating OneSignal (v 3.12.9) to 5.1.5 or 5.1.6 via SPM - doesn't work.
2. Xcode version 15.0

What did you expect to happen?

Should be able to update to latest OneSignal version.

OneSignal iOS SDK version

3.12.9

iOS version

16

Specific iOS version

I was testing / building it in Xcode using iOS Simulator 16.4 (and it didn't work, in fact, I could not add / update to the latest OneSignal version)

Relevant log output

No response

Code of Conduct

djavan-bertrand commented 5 months ago

Same problem with me. To fix it, I set the package to the exact version of 5.1.4.

nan-li commented 5 months ago

HI @jenbitcoin and @djavan-bertrand, thank you for reporting. We released version 5.1.6 recently and made an update to the files. Did you also clear SPMs package cache?

~/Library/Caches/org.swift.swiftpm/repositories

I am surprised version 5.1.5 is an issue for you as well. We released that version 2 weeks ago and made no changes to it.

kunalzigma commented 5 months ago

Cannot add Sdk in new app.

File1714812336222
artem-tverdokhlebov commented 5 months ago

same problem, for now will stick to 5.1.4

nan-li commented 5 months ago

Can reporters running into this confirm that removing ~/Library/Caches/org.swift.swiftpm/repositories did not work?

kunalzigma commented 5 months ago

Have removed OneSignal-XCFramework-75c1bc28 & OneSignal-XCFramework-fe10aafb folders from ~/Library/Caches/org.swift.swiftpm/repositories Now seeing this. Still not able to add.

Screenshot 2024-05-07 at 11 44 02 PM
jenbitcoin commented 5 months ago

Apologies for the late reply, I have slow internet the past few days and updating SPM was such a nightmare and blocks me from doing my tasks. I'll try again today and see if 5.1.4 works.

As for the recent releases, I had cleared cache, removed derived data, deleted trash and it was not working. I also asked another teammate to update OneSignal to latest version and she encountered the same issue with me.

kunalzigma commented 4 months ago

Hi, We really had schedule of a major update for our app completed last week and release this week, and eagerly needed push notifications. We are able to add 5.1.5 with exact version. Done the testing, setup, and everything with 5.1.5. But really needed the 5.1.6 as we don't know when we will be updating the app next. Similarly after the release of a newer 13 inch iPad, we will pushing updates to 3 other apps with onesignal.

So, we humbly request you to sort out this for us and others.

nan-li commented 4 months ago

Hi everyone, I'm not sure why this is not working for people reporting. What xcode version are you using?

I am using xcode 15.2, and cleaning all my package caches was sufficient to add version 5.1.6.

We do plan to release 5.1.7 this week, but version 5.1.6 may also be added via commit: fc88833146e426eb4f64806baf5e494212458cad as it corresponds to its Release 5.1.6. Curious does this work?

Screenshot 2024-05-08 at 10 34 01 AM

kunalzigma commented 4 months ago

Am on xcode 15.3 , and still same issue with adding that above SHA1 in commit. See the same as in the screenshot i provided before.

kunalzigma commented 4 months ago

If 5.1.7 will be released this week, i can wait, but now the information is there, that this issue was happening with xcode 15.3. Hope that you take care of this with the new version.

nan-li commented 4 months ago

I just tested with xcode 15.3, and was able to get the package.

Something with SPM is odd for some users, but I am not sure what... maybe some other configuration.

From the screenshots, the checksums indicate that SPM is returning an outdated / cached package for v5.1.6 as those are the old checksums. We updated the packages and checksums 7 days ago, so this downloaded package it is returning is over 7 days old.

The checksums we have currently are correct, and the correct packages are hosted, so I am not sure what we can do from our end.

EDIT to the above: ^ The only solution is we would have to make a new release.

SPM is grabbing the old packages and comparing the checksums to the current values.

nan-li commented 4 months ago

I'm looking for similar issues online, can you try these steps?

artem-tverdokhlebov commented 4 months ago

@nan-li On this commit, the command swift package resolve works, but on the previous one, it doesn't. It seems like it's trying to work with the commit that has a tag on it. Maybe this will help?

image

on 5.1.6 tag, checksum is specified as:

image

but in release it's different:

image

commit from first screenshot contains correct checksum:

image
nan-li commented 4 months ago

Hmm @artem-tverdokhlebov, interesting,

I did not update that tag as the the Package.swift file for v5.1.6 of the onesignal-xcframework indicates to go to, for example:

https://github.com/OneSignal/OneSignal-iOS-SDK/releases/download/5.1.6/OneSignalFramework.xcframework.zip

And the correct zips with the correct checksums live there. SPM should just be downloading the assets that live on that release.

Ah. You know what.... just as I typed that.... I looked at screenshots again and realized users are adding the dependency via onesignal-ios-sdk?

Our ios setup instructions indicate to use Enter Package URL: https://github.com/OneSignal/OneSignal-XCFramework.

I did not realize users were adding it via this repository as well, which thinking about it, makes sense that people would do this.

nan-li commented 4 months ago

I am updating the release and tag in this repository, but anyone encountering this issue can use Package URL: https://github.com/OneSignal/OneSignal-XCFramework

dfmuir commented 4 months ago

@nan-li using https://github.com/OneSignal/OneSignal-XCFramework resolved this issue for me and allowed me to install 5.1.6.

artem-tverdokhlebov commented 4 months ago

As I look at the previous replies, I can see that users were clearly adding https://github.com/OneSignal/OneSignal-XCFramework, but still encountered this issue. However, it seems to be working now. Thanks, @nan-li!

kunalzigma commented 4 months ago

I dont know what is going on. Seems like something is wrong. The day 5.1.6 was released , i was easily able to add it one of my projects. A day later , same project wasnt even able to fetch the sdk. It seems it is available for a particular time and then it is not. Like something is controlling it. Again, tried today right now , it didn't work. It might have been available when dfmuir & artem tried it because at that time, it was made available. Anyways, I already waited too much for this from past 2-3 months and still no use. Seems a good time, to migrate to another push notification service. I made a mistake of waiting too much. In other cases, i never do that and remain in advantage.

kunalzigma commented 4 months ago

And @nan-li , you can already in the screenshots, i was using the right url , the whole time. Even artem confirmed that.

nan-li commented 4 months ago

Hi @kunalzigma I'm sorry you are experiencing such a headache.

I see some people such as the original poster do appear to be using OneSignal-iOS-SDK. I am not sure what issue you are running into. I downloaded 5.1.6 on the day it released in an example project, and then updated it the next day after we fixed some code signatures in the SDK. I ran into the checksum errors but running the following commands worked for me:

rm -rf ~/Library/Caches/org.swift.swiftpm
rm -rf ~/Library/org.swift.swiftpm
rm -rf ~/Library/Developer/Xcode/DerivedData

I read that rm -rf ~/Library/Caches/com.apple.dt.* is also a command that worked for some people.

Have you tried running all 4 of these commands together?

kunalzigma commented 4 months ago

@nan-li the first 3 commands worked for me. I was able to get 5.1.6. Didnt need the 4th command. Thanks. Because 5.1.6 was performing great in one of our app added on 1st may , i needed it. But as you had announced 5.1.7 is around the corner, will be needing that too. Hopefully it comes out soon.

nan-li commented 4 months ago

Hi @kunalzigma that's great to hear those commands worked! We just released Release 5.2.0 which includes a new feature for Push to Start Live Activities amongst other updates.

I'll close out this issue, feel free to @ me if you run into any problems.