Closed BeRMaNyA closed 5 years ago
I just can't figure out where in onDestroy
the android.os.Handler.sendMessage
is called. Does changing onDestroy like this resolve the issue:
@Override protected void onDestroy ()
{
if( broadcastReceiver != null )
unregisterReceiver( broadcastReceiver );
super.onDestroy();
}
@yasirkula thanks, the original issue was caused due I placed this line compile project(':UnityProject')
into the wrong file.
Actually I searched for these lines releaseCompile
, debugCompile
and I got the wrong .gradle.
The weird thing that using compile project(':UnityProject
)` works fine inside this file: cordova/lib/plugin-build.gradle but makes the app crashes...
Then when I put this line compile project(':UnityProject')
into the app/build.gradle, I got a deprecation error.
In the end my build.gradle looks like this:
dependencies {
implementation fileTree(include: '*.jar', dir: 'libs')
// SUB-PROJECT DEPENDENCIES START
implementation project(path: ':CordovaLib')
implementation 'com.android.support:support-v4:24.1.1+'
implementation 'com.android.support:support-annotations:27.+'
// SUB-PROJECT DEPENDENCIES END
implementation project(':unityProject')
implementation files('/Users/berna/crisalix/MyCordova/platforms/android/libs/unity-classes.jar')
}
I needed to import the unity-classes.jar library into the android module.
Also I had to do this in the Unity project's build.gradle:
dependencies {
implementation files('/Users/berna/crisalix/MyCordova/platforms/android/libs/unity-classes.jar')
implementation files('libs/InAppBrowser.jar')
implementation files('libs/NativeGallery.jar')
implementation files('libs/UniWebView.aar')
}
Not sure if it's the best solution but worked fine for Unity 2018, now I'm going to try with Unity 2019.
Thanks for your time.
Hi, I'm facing an issue for about two days and I couldn't fix it yet... I think I tried everything.
I have implemented this plugin for IOS without issues, Unity works perfect but now I compile a new build for android and when I try to launch unity inside my Cordova app I got a crash with this error:
"App has stopped"
Logcat:
It seems the line that crash is this one:
I tried with an empty project and I got the same exception. I also tried Unity 2018 and Unity 2019.
Any help would be appreciated.
Thanks!