We’ve actually had this issue for a while, but because we hadn’t updated our version of Corona or OneSignal for months I thought it was something that would maybe fix itself once we updated.
We updated a few weeks ago and we’re still seeing the same crashes, which I believe are somehow related to OneSignal.
The crash only happens when the app is first opened after a fresh install, and it doesn’t happen every time. However, when it does happen it always happens as a segmentation fault during the function passed to IdsAvailableCallback.
Here’s a sample of our OneSignal code:
local onesignalPushToken = nil local onesignalPlayerID = nil function IdsAvailable(playerID, pushToken) print("[M] - PLAYER\_ID:" .. playerID) onesignalPlayerID = playerID if pushToken then -- nil if user did not accept push notifications on iOS print("[M] - PUSH\_TOKEN:" .. pushToken) onesignalPushToken = pushToken else print("token is nil") end if onesignalPlayerID then if isDebug then OneSignal.SendTags({["Lang"] = langInUse,["Version Number"] = globals.versionNumber, ["tester"] = "true"}) else OneSignal.SendTags({["Lang"] = langInUse,["Version Number"] = globals.versionNumber }) end end end OneSignal.Init(key, googleProjectNumber, DidReceiveRemoteNotification) OneSignal.IdsAvailableCallback(IdsAvailable)
Is there anything in there which appears to be wrong? Annoyingly I can’t actually get it to happen right now, even though it happened a bunch of times this afternoon, otherwise I would attach a log.
I’m not 100% sure if it happens on the version that is downloaded from the store, is it possible that there is a difference in how OneSignal receives push data in apps signed with an adhoc profile and ones signed with an app store profile?
I believe the issue you’re seeing should be fixed in OneSignal SDK 1.10.6+. To use the version you will need to build with Corona Build 2720+. We fixed a rare race condition with callback that can happen on view changes on iOS in version.
Also, while on the topic of duplicate symbols - there is a symbol that conflicts with another plugin I use:
duplicate symbol \_VERSION in: /Users/alan/QuizTix/mygame/iOS/ios/pollfish.framework/pollfish /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o)
I understand if it’s not feasible, but is there any way that could renamed to _ONESIGNAL_VERSION or something like that? I’ve asked the developer of the pollfish plugin as well, but I’m not sure who would be able to change it first.
I will start looking into these issues as soon as I can. I am currently having issues with my Corona account on getting a newer build of Corona Enterprise to test this.
I am not able to produce the error you listed above on Corona Enterprise build 2743 with Xcode 7.1. Can you confirm your also using the libplugin_OneSIgnal.a from CoronaEnterprisePlugins.2015.2743.tgz? If this is correct can you try removing and re importing the .a file into your Xcode project and restarting Xcode. Then do a Clean and rebuild again.
I’ve just tried again. I took a project that was already building correctly using Enterprise 2743 (however I’m using Xcode 6.4 at the moment).
I took the libplugin_OneSIgnal.a from CoronaEnterprisePlugins.2015.2743.tgz and copied it over the libplugin_OneSIgnal.a file that was already in the project, and got the same duplicate symbol error.
I then tried removing and reimporting the file, and cleaning the project. The rebuild still triggered the error.
If I put the old .a file back into the project then it builds correctly again.
The only difference I can see is that I’m using Xcode 6.4 instead of 7.1. Is there any reason you know of to explain why that would be making a difference here? I don’t think I’ll have a chance to update Xcode this week, so if that’s the cause of the problem I’ll only be able to confirm it some time next week.
I did some digging into the issue and there is an incompatibility issue with using libraries/frameworks built with Xcode 7 on Xcode 6.X when building for the simulator. If you need to keep using Xcode 6.4 with the simulator you will need to keep using the older version.
I believe the issue you’re seeing should be fixed in OneSignal SDK 1.10.6+. To use the version you will need to build with Corona Build 2720+. We fixed a rare race condition with callback that can happen on view changes on iOS in version.
Also, while on the topic of duplicate symbols - there is a symbol that conflicts with another plugin I use:
duplicate symbol \_VERSION in: /Users/alan/QuizTix/mygame/iOS/ios/pollfish.framework/pollfish /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o)
I understand if it’s not feasible, but is there any way that could renamed to _ONESIGNAL_VERSION or something like that? I’ve asked the developer of the pollfish plugin as well, but I’m not sure who would be able to change it first.
I will start looking into these issues as soon as I can. I am currently having issues with my Corona account on getting a newer build of Corona Enterprise to test this.
I am not able to produce the error you listed above on Corona Enterprise build 2743 with Xcode 7.1. Can you confirm your also using the libplugin_OneSIgnal.a from CoronaEnterprisePlugins.2015.2743.tgz? If this is correct can you try removing and re importing the .a file into your Xcode project and restarting Xcode. Then do a Clean and rebuild again.
I’ve just tried again. I took a project that was already building correctly using Enterprise 2743 (however I’m using Xcode 6.4 at the moment).
I took the libplugin_OneSIgnal.a from CoronaEnterprisePlugins.2015.2743.tgz and copied it over the libplugin_OneSIgnal.a file that was already in the project, and got the same duplicate symbol error.
I then tried removing and reimporting the file, and cleaning the project. The rebuild still triggered the error.
If I put the old .a file back into the project then it builds correctly again.
The only difference I can see is that I’m using Xcode 6.4 instead of 7.1. Is there any reason you know of to explain why that would be making a difference here? I don’t think I’ll have a chance to update Xcode this week, so if that’s the cause of the problem I’ll only be able to confirm it some time next week.
I did some digging into the issue and there is an incompatibility issue with using libraries/frameworks built with Xcode 7 on Xcode 6.X when building for the simulator. If you need to keep using Xcode 6.4 with the simulator you will need to keep using the older version.