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

Demo seems broken in Android and Unity 5.3.5f1 #11

Open
ASerdarSchell opened this issue May 26, 2016 · 13 comments
Open

Demo seems broken in Android and Unity 5.3.5f1 #11

ASerdarSchell opened this issue May 26, 2016 · 13 comments

Comments

@ASerdarSchell
Copy link

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?

@Aizee
Copy link

Aizee commented May 27, 2016

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()

@ASerdarSchell
Copy link
Author

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.

@Aizee
Copy link

Aizee commented Jun 1, 2016

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.

@patches34
Copy link

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.

@Aizee
Copy link

Aizee commented Jun 14, 2016

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.
folderstructure

@patches34
Copy link

patches34 commented Jun 15, 2016

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>

screen shot 2016-06-15 at 9 05 14 am

I am also using unity 5.3.1

@Aizee
Copy link

Aizee commented Jun 16, 2016

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>

@patches34
Copy link

Thank you so much that seems to get it working.

@Aizee
Copy link

Aizee commented Jun 16, 2016

Awesome 👍

@Radicaly2k
Copy link

It work for me but I am having trouble with another pluggin I implemented, for pick image.

Any ideas that could help me?

Thanks

@lasseastrup
Copy link

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

@Nezz
Copy link

Nezz commented Dec 9, 2016

@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.

@Hemaolle
Copy link

Our fork works now on Unity 5.4: https://github.com/YousicianGit/UnityNativeEdit.

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

No branches or pull requests

7 participants