Agasper / unity-android-notifications

Unity3D Plugin for Android local notifications with example project
Other
557 stars 184 forks source link

Problems with support-v4 #50

Closed andr-construction closed 7 years ago

andr-construction commented 7 years ago

First, let me say that this is a great and highly useful project! I'm having problems with integrating it due to support-v4 issues - despite adding it through dependencies in Android Studio I'm still getting errors and crashes. To make this work, I removed all references to support-v4 classes (like android.support.v4.app.NotificationCompat and android.support.v4.app.TaskStackBuilder), and managed to get the plugin to work, but it is clearly a hack. Two questions:

Agasper commented 7 years ago

Do you have test project working ? You don't need to put support library to gradle or plugin, put it into your Unity project Plugins/Android directory as in example

andr-construction commented 7 years ago

Thanks for the quick response! Compiling the test project failed, for some reason the .jar in it causes my Unity setup to fail with:

CommandInvokationFailure: Unable to convert classes into dex format. C:\Program Files\Java\jdk1.8.0_111\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/Projects/Unity/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

But I followed your advice, removed the references from my build.gradle and added the AARs directly to the Unity project - and it worked! Thank you very much! I've been struggling with this for 2 days now, couldn't find any clear guide/tutorial on how to use AARs in Unity/Android integration. Thanks again, now with notifications working I'll be moving on to the next hurdle on my project :)