universal-tools / UTNotificationsFeedback

7 stars 0 forks source link

Unity 2020.1.b16 Invalid Cast Exception #127

Open derwaldgeist opened 4 years ago

derwaldgeist commented 4 years ago

UTNofifications throws thousands of errors in the console if used with Unity 2020.1.b16. They all look like this:

InvalidCastException: Specified cast is not valid.
UTNotifications.Settings.GetAndroidResourceLibFolder (System.Boolean prepareResource) (at Assets/UTNotifications/Src/Settings.cs:652)
UTNotifications.Settings.CheckNotificationProfiles () (at Assets/UTNotifications/Src/Settings.cs:1036)
UTNotifications.Settings.CheckOutdatedSettings () (at Assets/UTNotifications/Src/Settings.cs:1022)
UTNotifications.Settings+SettingsHelper.Update () (at Assets/UTNotifications/Src/Settings.cs:973)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:332)

It is related to this line:

PluginImporter pluginImporter = (PluginImporter)AssetImporter.GetAtPath(assetPath);
yuriy-universal-ivanov commented 4 years ago

Hi @derwaldgeist , The issue is confirmed, we're working on a fix as a priority.

derwaldgeist commented 4 years ago

Great. We're still using Unity 2019 because of a lot of issues with the new version, so we don't need this urgently. But it would be very helpful once we upgrade.

Tillmania commented 3 years ago

Any word on a fix for this?

AAulicino commented 3 years ago

I found a workaround for this issue:

Starting from Unity 2020.1, all folders that work as a plugin requires the ".androidlib" at the end of the directory name.

To fix this issue:

  1. Rename the folder Assets/Plugins/Android/UTNotificationsRes/ to Assets/Plugins/Android/UTNotificationsRes/UTNotificationsRes.androidlib

  2. In Settings.cs, inside the method GetAndroidResourceLibFolder change the line string assetsRelativePath = "Android/UTNotificationsRes"; to string assetsRelativePath = "Android/UTNotificationsRes.androidlib";

derwaldgeist commented 1 year ago

Ok, it's 2 years later now, but still no updated package solving this? Is this package even maintained? I saw that the last push to the Unity asset store was from 2019 (!).