Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ClassNotFoundException when sending a message from Unity to Flutter (Android) #41

Closed
timonvw opened this issue Sep 5, 2019 · 2 comments · Fixed by #61
Closed

Comments

@timonvw
Copy link

timonvw commented Sep 5, 2019

I get this error in the debug console (Android Studio) when I send a message in Unity to Flutter.

Error:

E/Unity ( 8367): java.lang.ClassNotFoundException: Didn't find class "com/reactnative/unity/view/UnityUtils" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.rexraphael.flutterunitywidgetexample-A3IZZoUXENEbVBkqDGNLAQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.rexraphael.flutterunitywidgetexample-A3IZZoUXENEbVBkqDGNLAQ==/lib/arm64, /data/app/com.rexraphael.flutterunitywidgetexample-A3IZZoUXENEbVBkqDGNLAQ==/base.apk!/lib/arm64-v8a, /system/lib

image

Code Unity:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Rotate : MonoBehaviour
{
    [SerializeField]
    //Vector3 RotateAmount;
    private float rotSpeed = 5f;

    private UnityMessageManager messanger;
    

    // Start is called before the first frame update
    void Start()
    {
        messanger = new UnityMessageManager();
    }

    private void OnMouseDrag()
    { 
        //Rotate object
        float rotX = Input.GetAxis("Mouse X") * rotSpeed * Mathf.Deg2Rad;
        transform.RotateAround(Vector3.up, -rotX);

        //send message to FLutter
        messanger.SendMessageToFlutter("Test");
    }
}

image

@rafbanaan
Copy link

I'm having the same issue here.

@thomas-stockx
Copy link
Collaborator

Hey guys, sorry for the late reply.

Be sure you use the latest UnityMessageManager.cs from the scripts folder.
The issue you're reporting should've been fixed by this PR: #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants