yasirkula / UnityIonicIntegration

A guide to integrating Unity 3D content into an Ionic app and sending messages between them (for Android & iOS)(tested with Vuforia plugin)
104 stars 32 forks source link

error: cannot find symbol class UnityPlayer #28

Closed bbiaudet closed 6 years ago

bbiaudet commented 6 years ago

Hello, I encounter a compilation problem under android studio 3.1.2, when I delete the unity-classes.jar file in the libs folder of the android project, I have 7 compilation errors:

error: can not find UnityPlayer class symbol
error: can not find symbol class UnityPlayerActivity
error or method not applicable or a method from a supertype
error: registerReceiver (IonicToUnityBroadcastReceiver, IntentFilter)
error or method not applicable or a method from a supertype
error: can not find symbol variable super
error: can not find symbol method setResult (Int, Intent)
yasirkula commented 6 years ago

Did you change 'C:\\absolute path\\to your\\unity export folder' with your Unity export folder? Can you see UnityProject next to android in Project view in Android Studio?

bbiaudet commented 6 years ago

Yes I changed the way and the project unity is well linked in the project android studio.

capture d ecran 2018-05-30 a 11 33 05

yasirkula commented 6 years ago

Is there a unity-classes.jar located at UnityProject/libs? If so, can you verify that you've put compile project(':UnityProject') to the correct location?

bbiaudet commented 6 years ago

Yes is located at UnutyProject/libs.

capture d ecran 2018-05-30 a 12 44 00

If I leave the .jar in the android project I have a double class loading error

yasirkula commented 6 years ago

Does changing implementation project(':UnityProject') to compile project(':UnityProject') or api project(':UnityProject') solve the issue?

bbiaudet commented 6 years ago

no for api some error, for compile error is obsolete

yasirkula commented 6 years ago

I'm out of ideas. As a last resort, you can move UnityProject/libs/unity-classes.jar to android/libs.

bbiaudet commented 6 years ago

capture d ecran 2018-05-30 a 13 26 57

yasirkula commented 6 years ago

At this point, any help is appreciated.

bbiaudet commented 6 years ago

I managed the compilation, I just downgrade Gradle 4.4. at 3.5.

thanks again for help

yasirkula commented 6 years ago

That's great news! I may update the README if someone else encounters the same issue, as well.

bbiaudet commented 6 years ago

Yep!