Open ASerdarSchell opened 8 years ago
I am experiencing the same issue with Unity 5.3.4f1 / Android 6.0.1
Unity input works fine until the native text box is created. It then seems that all Unity input is disabled. I don't see any errors in my logcat logs.
on text box open
05-27 10:45:12.529 1232 1232 I Keyboard.Facilitator: onFinishInput() 05-27 10:45:12.531 1232 1232 I Keyboard.Facilitator: onStartInput() 05-27 10:45:12.545 1232 1232 D KeyboardTheme: No property defined for ro.com.google.ime.theme_id 05-27 10:45:12.545 1232 1232 I LatinIME: Starting input. Cursor position = 4,4 05-27 10:45:12.635 1232 1232 I Keyboard.Facilitator: resetDictionaries() : no-op 05-27 10:45:12.635 1232 1232 I StatsUtilsManager: onLoadSettings()
on text box close
05-27 10:45:15.301 1232 1232 I Keyboard.Facilitator: onFinishInput()
Turns out the issue is part of the build process, specifically the AndroidManifest.xml file. It is not being included in the build when the plugin is imported normally.
It seems like the default import process puts the plugin's files into a folder called NativeEditPlugin and any android files into Assets/NativeEditPlugin/Plugins/Android.
According to https://issuetracker.unity3d.com/issues/library-folder-not-recognised-as-a-library-outside-of-assets-slash-plugins Android library folders are, by design, not recognized by Unity unless they are in Assets/Plugins/Android.
So, steps to resolve seems to be move the contents of /Assets/NativeEditPlugin/ into /Assets/, save the project, then rebuild.
The default import location should be updated to fix this issue.
Thanks for fix. After the fact I ran into the issue of having to merge multiple manifests from different plugins. A bit of a pain but definitely workable.
I seem to be having the same problem as you 2. That once an inputfield is displayed i can only interact with that field and not the rest of my UI.
I tried moving the files out of /Assets/NativeEditPlugin/ into /Assets/ but I am still getting the same results.
Are you using another plugin that already has a manifest file located at /Assets/Plugins/Android?
Just for reference, this is the folder structure of the demo that worked for me.
Yes I do have a already have a manifest file at /Assets/plugins/androind. I added the ForawrdNativeEventsToDalvik meta-data field.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.LoginActivity" android:configChanges="keyboardHidden|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityGameRequestActivity" />
<activity android:name="com.facebook.unity.FBUnityCreateGameGroupActivity" />
<activity android:name="com.facebook.unity.FBUnityJoinGameGroupActivity" />
<activity android:name="com.facebook.unity.AppInviteDialogActivity" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb745374408922509" />
<provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider745374408922509" android:exported="true" />
<activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
</application>
</manifest>
I am also using unity 5.3.1
Try replacing the com.unity3d.player.UnityPlayerActivity enclosure with this
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
Thank you so much that seems to get it working.
Awesome 👍
It work for me but I am having trouble with another pluggin I implemented, for pick image.
Any ideas that could help me?
Thanks
I'm struggling with this as well in Unity 5.4 - I created a brand new project only containing this and if there's any NativeEditBoxes in the scene I can only interact with those and not anything else. Can any of you get the demo scene running in 5.4?
Thanks
@Aizee Do you have any solution that works with Unity 5.4? That version dropped support for UnityPlayerNativeActivity
:
Android: Deprecated UnityPlayerNativeActivity and UnityPlayerProxyActivity; these will now print warnings to the logcat if in use. (edited) Android: Removed native activity implementation. An activity with the same name based on a regular activity is still in place for backwards compatibility reasons.
Our fork works now on Unity 5.4: https://github.com/YousicianGit/UnityNativeEdit.
Only the Native Text Boxes work in the demo While the buttons and the regular Text Boxes don't register taps.
Looking at the logs there seems to be an error in the start routine.
05-25 16:33:55.290: I/NativeEditPlugin(22577): Found leaf view 05-25 16:33:55.290: I/NativeEditPlugin(22577): InitEditBoxPlugin okay 05-25 16:33:55.508: E/NativeEditPlugin(22577): EditBox not found 05-25 16:33:55.563: I/Unity(22577): AndroidJavaException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.toString()' on a null object reference 05-25 16:33:55.563: I/Unity(22577): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.toString()' on a null object reference 05-25 16:33:55.563: I/Unity(22577): at com.bkmin.android.NativeEditPlugin.SendUnityMsgToPlugin(NativeEditPlugin.java:148) 05-25 16:33:55.563: I/Unity(22577): at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 05-25 16:33:55.563: I/Unity(22577): at com.unity3d.player.UnityPlayer.a(Unknown Source) 05-25 16:33:55.563: I/Unity(22577): at com.unity3d.player.UnityPlayer$b.run(Unknown Source) 05-25 16:33:55.563: I/Unity(22577): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in:0
05-25 16:33:55.563: I/Unity(22577): at UnityEngine.AndroidJNISafe.CallStaticStringMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in :0
05-25 16:33:55.563: I/Unity(22577): at UnityEngine.AndroidJavaObject._CallStatic[String](System.String methodName, System.Object[] args) [0x00000] in :0
05-25 16:33:55.563: I/Unity(22577): at UnityEngine.AndroidJavaObject.CallStatic[String] (System.String methodName, Sys
Any thoughts as to what the issue might be?