Hi, I’ve just tried 2022.3
The windows build runs fine, not the android one.
First I had errors during the build, some process trying to write to the file
2022.3.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml
which was not creatable due to file-system privileges when located in c:\programfiles
uninstalling from C: and re-installing to D: solved this issue (weird)
Then I get these errors, any help is welcome :
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
D:\Perforce\NFT\Library\Bee\Android\Prj\Mono2x\Gradle\launcher\src\main\AndroidManifest.xml:4:2-98 Warning:
uses-permission#android.permission.READ_EXTERNAL_STORAGE was tagged at AndroidManifest.xml:4 to replace another declaration but no other declaration present
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
D:\Perforce\NFT\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:164: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
^
symbol: variable TIRAMISU
location: class VERSION_CODES
D:\Perforce\NFT\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:165: error: cannot find symbol
permissionGranted = mContext.checkCallingOrSelfPermission(Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
^
symbol: variable POST_NOTIFICATIONS
location: class permission
Note: D:\Perforce\NFT\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
I think you have to download Android SDK 33. At least that fixed it for me.
This is how I did it.
1- Edit > Project Settings > Player > Minimum API Level > Android 13 (API version 33).
2- File > Build And Run
The build and run will ask you to download SDK 33 (if not already), you just have to confirm.
Don’t forget to set the Minimum API Level back to whatever version you need.
I think you should be able to do the same by modifying Target API Level to Android 13 instead of Minimum API Level (if you have it as an option).
Had the same problem. Can be fixed by changing “Edit > Project Settings > Player > Target API Level” to Android 13. Changing the Minimum API level would prevent the app from being released to older android versions.
Oh My Lord bro, you saved me. I spent 10 days searching for a solution and thought that my code is causing this stupid error, reinstalling every single sdk, ndk and jdks. Thanks
To @hippogames and @JulienPlayrion - you can switch it back once you’ve done the build once and all is fine. It just needs to be set to 33 once to get it to install the right SDK.
Thanks, this is not a solution that is compatible with a CI/CD environment though, unfortunately. Thank you for reporting the bug, don’t hesitate to share the issue’s link so we can vote for it!
No, this doesn’t work as the androidnotifications package requires API 33. I was able to downgrade com.unity.mobile.notifications to 2.1.1 by editing packages-lock.json and manifest.json. And now I can use API 31.
Mobile Notifications only require SDK 33 at compile time. For runtime it supports 21+.
You don’t need to change minimum API level, you can set target level to 33.
Alternatively you can modify gradle files to set compile sdk to 33, then your target sdk can be lower.
Worked for me as well. By removing the Mobile Feature pack, I was able to downgrade the notification package to 2.0.2 and set my Minimum API Level back to 22. Thank you !