OneSignal no longer supported?

Kept getting the following errors when using the newer builds (> 3672). It was previously working fine for 3642.

java.lang.VerifyError: Verifier rejected class androidx.work.impl.OperationImpl: com.google.common.util.concurrent.ListenableFuture androidx.work.impl.OperationImpl.getResult() failed to verify: com.google.common.util.concurrent.ListenableFuture androidx.work.impl.OperationImpl.getResult(): [0x2]  can't resolve returned type 'Unresolved Reference: com.google.common.util.concurrent.ListenableFuture' or 'Unresolved Reference: androidx.work.impl.utils.futures.SettableFuture' (declaration of 'androidx.work.impl.OperationImpl' appears in /data/app/~~BD1rnOX3WfcleXobtjAViA==/com.td.dailylent-m-T_In-pCK5s52-TBFizag==/base.apk)
    at androidx.work.impl.utils.EnqueueRunnable.<init>(EnqueueRunnable.java:79)
    at androidx.work.impl.WorkContinuationImpl.enqueue(WorkContinuationImpl.java:186)
    at androidx.work.impl.WorkManagerImpl.enqueueUniqueWork(WorkManagerImpl.java:409)
    at androidx.work.WorkManager.enqueueUniqueWork(WorkManager.java:351)
    at com.onesignal.OSNotificationRestoreWorkManager.beginEnqueueingWork(OSNotificationRestoreWorkManager.java:49)
    at com.onesignal.OneSignal.handleActivityLifecycleHandler(OneSignal.java:968)
    at com.onesignal.OneSignal.init(OneSignal.java:845)
    at com.onesignal.OneSignal.setAppId(OneSignal.java:728)
    at com.onesignal.OneSignal.reassignDelayedInitParams(OneSignal.java:1174)
    at com.onesignal.OneSignal.onRemoteParamSet(OneSignal.java:882)
    at com.onesignal.OneSignal$7.complete(OneSignal.java:1115)
    at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:211)
    at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
    at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:156)
    at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:279)
    at java.lang.Thread.run(Thread.java:923)v

Do you get this while building your app?

I have been on 3682 for some time and haven’t experienced any problem with OneSignal

No issue when building the app… But the app closes immediately upon launch. Then from the log, I can see the errors above.

It is working fine for build 3642 but the API target is only 29 and I cannot submit this app to the Google Play store which expects at least 31.

Hmm
I have submitted a few builds during the last month all built on fairly recent solar2d releases but we havent encountered this problem. Push messages are also being delivered as expected.

Have you tried deleting the cached plugins and letting the simulator re-download those? It is possible you are on an older onesignal build perhaps

Thank you for your suggestion. I did what you advised and deleted all the cached plugins… but unfortunately, I am still getting the same error message. I am using Build 3682 just like what you did.

Once I removed the line

OneSignal.Init("< appId>", “< googleProjectNumber>”, DidReceiveRemoteNotification), it is able to launch.

This is my build settings file.

– Supported values for orientation:
– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

settings = {
orientation = {
default = “portrait”,
supported = { “portrait”}
},
splashScreen =
{
ios = {
enable = false
},
android = {
enable = true,
image = “Default-568h@2x.png”
}
},
android =
{
useGoogleServicesJson = true,
usesPermissions =
{
“android.permission.INTERNET”,
“com.android.vending.BILLING”,
},
intentFilters =
{
{
label = “”,
actions = { “android.intent.action.VIEW” },
categories =
{
“android.intent.category.DEFAULT”,
“android.intent.category.BROWSABLE”,
},
data = { scheme = “” },
},
},
applicationChildElements =
{
[[

]],
}
},
iphone = {
xcassets = “Images.xcassets”,
plist = {
GADApplicationIdentifier = “”,
SKAdNetworkItems = {
{
SKAdNetworkIdentifier = “cstr6suwn9.skadnetwork”,
},
},
MinimumOSVersion = “10.0”,
UIBackgroundModes = {“audio”, “remote-notification”},
UIStatusBarHidden = false,
UIPrerenderedIcon = true, – set to false for “shine” overlay
UILaunchStoryboardName = “LaunchScreen”,
UIUserInterfaceStyle = “Light”,
CFBundleDisplayName = “Daily Advent”,
NSLocationAlwaysUsageDescription = “This app would like to use location services.”,
NSLocationWhenInUseUsageDescription = “This app would like to use location services.”,
NSUserTrackingUsageDescription = “This identifier will be used to deliver personalized ads to you.”,
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“”
}
}
},
LSApplicationQueriesSchemes =
{
“kindle”,
“fbapi”,
“fbauth2”,
“fb-messenger-api”,
“fbshareextension”,
“instagram”,
},
NSAppTransportSecurity =
{
NSAllowsArbitraryLoads = true
},
}
},
plugins =
{
[“plugin.admob”] =
{
publisherId = “com.coronalabs”
},
[“plugin.OneSignal”] =
{
publisherId = “com.onesignal”,
},
[“CoronaProvider.native.popup.activity”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, [“iphone-sim”]=true },
},
[“CoronaProvider.native.popup.social”] =
{
publisherId = “com.coronalabs”
},
[“plugin.google.iap.billing.v2”] =
{
publisherId = “com.solar2d”
},
[‘plugin.att’] = { publisherId = ‘com.solar2d’, supportedPlatforms = { iphone=true, [“iphone-sim”]=true },},
}
}

Anyone can help? Thanks in advance. :pray:

@famousdoggstudios

Can you share with me your build.settings especially the Android section?

My build.settings looks like this:

settings =
{
	plugins =
    {

       
        ["CoronaProvider.native.popup.social"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true, android=true }
        },
        ["CoronaProvider.native.popup.activity"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true}
        },
        ["plugin.notifications.v2"] =
        {
            publisherId = "com.coronalabs"
        },
        ["plugin.google.iap.billing.v2" ] =
        {
            publisherId = "com.solar2d"
        },
        ['plugin.vibrator'] = 
        {
            publisherId = 'com.fd'
        },
        ['plugin.installerID'] = 
        {
            publisherId = 'com.fd'
        },
        ["plugin.gpgs"] = {
            publisherId = "com.coronalabs",
            supportedPlatforms = {android = true}
        },
        ["CoronaProvider.gameNetwork.apple"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true }
        },
        ['plugin.att'] = 
        { 
            publisherId = 'com.solar2d' 
        },
         ["plugin.advertisingId"] =
        {
            publisherId = "com.coronalabs"
        },
         ["plugin.ironSource"] =
        {
          publisherId="tech.scotth",
          marketplaceId = "xxxxx",
        },


        ["plugin.unityAdsIron"] = {
            publisherId = "tech.scotth",
            supportedPlatforms =
            {
                android = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=unityAds&type=Android" },
                iphone = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=unityAds&type=iOS" },
            },
        },
        
        ["plugin.facebookIron"] = {
          publisherId = "tech.scotth",
          supportedPlatforms =
          {
             android = { url="http://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=facebook&type=Android" },
             iphone = { url="http://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=facebook&type=iOS" },
          }, 
        },
        
        ["plugin.reviewPopUp"] =
        {
            publisherId="tech.scotth",
            marketplaceId = "xxxxx",
        },

        ['plugin.facebook.v4a'] = {
            publisherId = 'com.coronalabs'
        },
        
        ["plugin.applovinIron"] = {
             publisherId = "tech.scotth",
             supportedPlatforms =
             {
                 android = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=applovin&type=Android" },
                 iphone = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=applovin&type=iOS" },
             },
        },

        ["plugin.adColonyIron"] = {
             publisherId = "tech.scotth",
             supportedPlatforms =
             {
                 android = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=adColony&type=Android" },
                 iphone = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=adColony&type=iOS" },
             },
        },

         ["plugin.OneSignal"] =
        {
            publisherId = "com.onesignal",
        },

        ['plugin.mixpanel'] = 
        {
            publisherId = 'com.yogergames'
        },
    },

    splashScreen = 
    {
        enable = false
    },
	
	orientation =
	{
		-- Supported values for orientation:
		-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight

		default = "portrait",
		supported = { "portrait" }
	},
	
	excludeFiles =
	{
		-- Include only the necessary files on each platform, if "Icon.png" is for iphone then exclude it from android by adding it in the android table
        -- excludes files from builds for a specific platforms
		iphone = { "Icon-*dpi.png"},
		android = { "Icon.png", "Icon-Small-*.png", "Icon*@2x.png" },
        -- include only those files in this table which are to be excluded from all the platforms.
        all = {"Calling points.docx", "hostage.JPG", "player.JPG", "zombie.JPG"},
	},

	--
	-- Android Section
	--
	android =
	{  

        usesPermissions =
        {
            "android.permission.INTERNET",
            "android.permission.ACCESS_NETWORK_STATE",
            "android.permission.GET_ACCOUNTS",
            "com.android.vending.BILLING",
            "android.permission.ACCESS_COARSE_LOCATION",
            "android.permission.ACCESS_WIFI_STATE",
            "com.google.android.gms.permission.AD_ID",
            "android.permission.WRITE_EXTERNAL_STORAGE",
            "android.permission.VIBRATE",
        },
        applicationChildElements =
        {
            --this meta data is being added because for network security android now only allows secure connections(via https, called cleartext) if app is trying to connect an external server/database etc.
            --We need to opt out of supporting cleartext because our backend(app42) uses http protocol. To include more domains that opt of of this service, see the network_security_config.xml file.
            [[
                <meta-data android:name="networkSecurityConfig"
                    android:value="@xml/network_security_config"/>
            ]],

            --below is for FB so that we can track app events and use those to run ads for this app on FB ads
            [[
                <provider android:authorities="com.facebook.app.FacebookContentProviderxxxx"
                          android:name="com.facebook.FacebookContentProvider" android:exported="true"/>
            ]],

            [[
                <meta-data android:name="xxxx"/>
            ]],

            -- This is for the applovin max plugin
            [[
                <meta-data android:name="applovin.sdk.key" android:value="xxxxx"/>
            ]],
        },
        facebookAppId = "xxxxx",
        googlePlayGamesAppId = "xxxxx",
        useGoogleServicesJson = true,
        minSdkVersion = "26", -- this version corresponds to Android 8
	},

The script below is all the code that I have in my projects for accessing this plugin:

local oneSignalManager={}

local oneSignal=require("plugin.OneSignal")
local analytics=require "scripts.helperScripts.analytics"
local rewardCodeHandler=require "scripts.helperScripts.rewardCodeHandler"
local toast=require "scripts.helperScripts.toast"

----------------
local function DidReceiveRemoteNotification(message, additionalData, isActive)
    if (additionalData) then--additional data is a table of KV pairs that can be passed in from the dashbaord when sending messages to devices
        if (additionalData.rewardCode) then--if a rewardCode key was found in additional data, call necessary helper scripts to implement that reward code. 
            -- native.showAlert( "REWARD CODE", additionalData.rewardCode, { "OK" } )--this can be turned on for debug purposes
            analytics.sendTrackingEvent("EnteredUsingNotification")
            --perform necessary actions here for giving reward:
            rewardCodeHandler.performActionByCode(additionalData.rewardCode)
        end
    else
        native.showAlert("MESSAGE RECEIVED!", message, { "OK" } )--this will show an alert for a message that is received WHEN THE MESSAGE DOESN:T containt a reward code
    end
end

---------------
--init- add in the project/app id from onesignal dashboard and the second argument is google project number
oneSignal.Init("xxxxx", "xxxxxx", DidReceiveRemoteNotification)
---------------

-- tag users as ios or android or test depending on their os or debugMode state to allow segmentation on dashboard.
-- if debug mode is on then make the device subscribe to the test segment. This can be used to test push notifications.
if (isDebugMode) then 
    oneSignal.SendTag("app", "test")
elseif( system.getInfo("platform") == "android" ) then
    oneSignal.SendTag("os", "android")
else
    oneSignal.SendTag("os", "ios")
end

return oneSignalManager

Thank you so much for sharing. Unfortunately, after trying out for 2 days, I am still unable to resolve this issue. Still getting the same error whenever I tried to do an init() for OneSignal.

@famousdoggstudios

May I know which Android SDK version are you using for your OneSignal plugin?

Mine is 2022.3672-android.tgz

Yes, I happen to be on the same version. I’ve had to build a few of our apps again for Android during the last few days and I’ve not experienced this still. As a last resort, can you try deleting/uninstalling your entire Solar2D environment including the plugins, Android SDK etc and then try from scratch?

I did remove my Solar2D before and also all the downloaded plugins before trying.

Can you please advise on your Android SDK version and also Java version? Thank you. :pray:

I contacted OneSignal team but they are unwillingly to help since they are no longer involved in supporting this platform.

I also had issues with OneSignal and newer android releases. I ended up just removing it because there was no way to fix the issues on my end. The SDK needs to be updated. I would get random crashes and issues all related to it. It was working fine for the past 4 years before that.

I am on the 1.8.0_242 open jdk which is the one solar seems to procure automatically. Not sure of the Android SDK version but again, it’s the one that Solar downloads because I don’t build natively for Android any more so I haven’t manually changed anything. @Falcon777

@vlads It seems that multiple users have issues with OneSignal and the plugin’s official support has been withdrawn. There’s no other viable service on Solar2d at this point for push messaging unless one decides to do a deep dive into firebase etc (not sure how extensive those plugins are at this point)-- is there a plan to provide support for one signal going forward?

May I know which push notification service are you using now for Solar2D?

Thank you for sharing! I am doing some native Android development. That could be the reason.

Hope someone can release an updated OneSignal plugin here since official support is no longer available.

I didn’t replace it with anything, so right now my Android players have no push notifications.