Open GorkemSvn opened 1 year ago
Update I've updated sdk to 3.0.7 Created an empty project(unity 2020.3.42), imported onesignal sdk. get a build while minify is off. Saw my phone succesfully register to audience of onesignal enabled the minify, cleared the audience from onesignal site. got another build no audience registered. fail
Perbarui Saya telah memperbarui sdk ke 3.0.7 Membuat proyek kosong (unity 2020.3.42), mengimpor sdk satu sinyal. dapatkan build saat minify tidak aktif. Melihat ponsel saya berhasil mendaftar ke audiens onesignal mengaktifkan minify, menghapus audiens dari situs onesignal. mendapat build lain, tidak ada audiens yang terdaftar. gagal
Can we build now using minify?
Can you try adding this line to your Proguard config:
-keep com.onesignal.** { *; }
This will ensure all OneSignal classes are kept when minifying. You can consider this as a work around for now.
We will look into designing a Proguard config that can still allow some minification to OneSignal and include it in a future update so a manual step won't alway be required.
Okay I’ll try it. Thanks!
From: Josh @.> Sent: Friday, May 5, 2023 18:55 To: @.> Cc: @.>; @.> Subject: Re: [OneSignal/OneSignal-Unity-SDK] [Bug]: AndroidJavaException: java.lang.ClassNotFoundException: com.onesignal.OneSignal (Issue #562)
Can you try adding this line to your Proguard config:
-keep com.onesignal.* { ; }
This will ensure all OneSignal classes are kept when minifying. You can consider this as a work around for now.
We will look into designing a Proguard config that can still allow some minification to OneSignal and include it in a future update so a manual step won't alway be required.
— Reply to this email directly, view it on GitHubhttps://github.com/OneSignal/OneSignal-Unity-SDK/issues/562#issuecomment-1536457023, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKPMVB4UTAJ5CR54KXZ7K7LXEUPFXANCNFSM6AAAAAASLAK7SE. You are receiving this because you authored the thread.Message ID: @.***>
I have the same issue. I test on editor, no error found. I build the apk, and test it on my android phone, nothing happen. It should have asking to subscribe or something, right? I check on onesignal dashboard, no entry at all.
I found out that the code went error when calling this line: OneSignal.Initialize("MY ONE SIGNAL ID"); Using try and catch in the build apk, I managed to print to text UI, the error message from exception variable: java.lang.ClassNotFoundException: com.onesignal.OneSignal
I don't use proguard, I just follow the step from onesignal unity sdk setup steps. I don't use any other plugins, just this one.
Same issue. No proguard/minify active. Using the last OneSignal version "5.0.5" and Unity 2022.3.2. Getting_ java.lang.ClassNotFoundException: com.onesignal.OneSignal on android build
On this ClassNotFoundException
with OneSignal-Unity-SDK v5 versions, this should have been fixed when updating to OneSignal-Unity-SDK 5.0.3, however it is important you follow this step from the release notes if coming from an older SDK version:
You must run the "Copy Android plugin to Assets" step in Window > OneSignal SDK Setup.
Please let us know if following this step fixes the issue for you. If not please provide an example Unity project so we can produce the issue on our end.
What happened?
Update: I've figured out unity's proguard minify doesn't include some dependencies onesignal needs, resulting one signal initialization to fail. I can't disable minify because i can't build without it. So onesignal needs to patch itself to be compatible with proguard minify.
It looks like unity's single dex file is not enought to hold firebase firestore,auth and onesignal and using minify breaks things
I'm followed one signal unity sdk setup steps , no problems in editor. Wrote single line of code in my notificationsmanager c# script( OneSignal.Default.Initialize("xcvsdv");) But when i had built in my samsung phone a70, i didn't receive any notification ( i sent notification from dashbouard.) I noticed my phone haven't subscribed to audience. And got this message from autoconnected profiler
note: i did not do steps for amazon-store
AndroidJavaException: java.lang.ClassNotFoundException: com.onesignal.OneSignal![image](https://user-images.githubusercontent.com/43960967/203917182-1ad33884-2d82-4231-ae07-961ebf4cb1da.png)
Steps to reproduce?
What did you expect to happen?
App to subscribe to onesignal audience
Unity version
2020.3.42
OneSignal Unity SDK version
3.0.6
Platform
Android
Relevant log output
No response
Code of Conduct