OneSignal-Unity-SDK
OneSignal-Unity-SDK copied to clipboard
[Bug]: this won't work on Amazon devices by design
What happened?
At this point, I'm wondering if anyone out there tests these things or even if they are used. I found two major bugs in the last 24 hours that don't even allow anyone to run this system in Unity. what gives?
Here is the thing, by your documentation, on amazon devices you need to generate an api_key.txt file and place it on the "assets" folder on /plugins/android/assets This is stated in your documentation: https://documentation.onesignal.com/docs/unity-sdk-setup Scroll down to point 5.6 and it literally says: 5.6 Place your api_key.txt in a new folder named assets under Assets/Plugins/Android/
Now, do that. Enjoy the fun with Unity 2021.2.18f for instance. The latest stable release but it has been like this for over a year... when you try to build for your amazon device, you will get this error: Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/assets was removed, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more details.
You see, the "assets" folder has been deprecated for... 2 years? 1 year? I don't know. I can't even remember. So there is no way on you can compile any project for Amazon using this sdk in Unity. How were you able to test it? I wonder.
How do we fix this? If the api_key.txt is not included, the project will build but then it will crash as soon as you try to initialize the OneSignal sdk on the device saying that the key is missing. So where or how do we use it?
Steps to reproduce?
1. Setup your amazon sdk.
2. Setup your api_key.txt in the /plugin/android/assets folder as your documentation states.
3. If you manage to build and run with that folder structure in Unity 2021.2.18, i pay the drinks.
What did you expect to happen?
I would expect it to compile and run.
Unity version
2021.2.18 (latest)
OneSignal Unity SDK version
3.0.0
Platform
Android
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
You can solve this by copying the api_key.txt file into the Streaming folder of unity, instead of the /android/assets one. Everything in the Streaming folder gets copied into the assets folder at build time without modification. Please update the documentation.