Getting crashes on iOS when first installing an app

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?

Hello,

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.

Thanks.

It took me a while to get around to updating, I’ve just updated to build 2743 and when I try to build with the new lib I get the following error:

duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(LuaLibraryShim.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(LuaLibraryShim.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalCoronaDelegate.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalCoronaDelegate.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(plugin\_OneSignal.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(plugin\_OneSignal.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(GameThrive.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(GameThrive.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalTrackIAP.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalTrackIAP.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalJailbreakDetection.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalJailbreakDetection.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalHTTPClient.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalHTTPClient.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalMobileProvision.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalMobileProvision.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalReachability.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalReachability.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o)

Usually when I see duplicate symbol errors there are 2 separate plugins named, but these seem to all be within the OneSignal plugin.

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.

Hello,

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.

Thanks.

Hey Alan,

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.

Thanks.

Sorry for the delay getting back to you.  

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.

Thanks.

Hello,

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.

Thanks.

It took me a while to get around to updating, I’ve just updated to build 2743 and when I try to build with the new lib I get the following error:

duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(LuaLibraryShim.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(LuaLibraryShim.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalCoronaDelegate.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalCoronaDelegate.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(plugin\_OneSignal.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(plugin\_OneSignal.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(GameThrive.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(GameThrive.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalTrackIAP.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalTrackIAP.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalJailbreakDetection.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalJailbreakDetection.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalHTTPClient.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalHTTPClient.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalMobileProvision.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalMobileProvision.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalReachability.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignalReachability.o) duplicate symbol \_llvm.cmdline in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o) duplicate symbol \_llvm.embedded.module in: /Users/alan/QuizTix/mygame/iOS/ios/libplugin\_OneSignal.a(OneSignal.o)

Usually when I see duplicate symbol errors there are 2 separate plugins named, but these seem to all be within the OneSignal plugin.

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.

Hello,

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.

Thanks.

Hey Alan,

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.

Thanks.

Sorry for the delay getting back to you.  

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.

Thanks.