sanukin39 / UniClipboard

Simple clipboard plugin for unity
MIT License
309 stars 59 forks source link

Android: Copy works fine, Paste cause app crash. IOS : copy and paste both work fine. #10

Open bhupiister opened 3 years ago

bhupiister commented 3 years ago

While copying to android from outside apps like WhatsApp or note editor, as soon as we paste, the app crashes. The same code is working for IOS without any change. Can you please get a workaround for android?

bhupiister commented 3 years ago

Here is the log snipper, i dont know if you will find something useful. 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at libart.art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::(anonymous namespace)::JniValueType*)(:652) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at libart.art::(anonymous namespace)::CheckJNI::GetStringLength(_JNIEnv*, _jstring*)(:544) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at libunity.0x1bd633(Native Method) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at libunity.0x1c00c1(Native Method) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.AndroidJNI.CallStringMethod (intptr,intptr,UnityEngine.jvalue[])(Native Method) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.AndroidJNISafe.CallStringMethod (intptr,intptr,UnityEngine.jvalue[])(0x27:39) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.AndroidJavaObject._Call<ReturnType_REF> (string,object[])(0x78f:1935) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.AndroidJavaObject.Call<ReturnType_REF> (string,object[])(0x33:51) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at AndroidBoard.GetText ()(0x33:51) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UniClipboard.GetText ()(0x1f:31)

12-10 15:04:58.631 14640 14691 E AndroidRuntime: at multiplayer_play_with_friends.PasteButton ()(0x1b:27) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.Events.InvokableCall.Invoke ()(0x3b:59) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.Events.UnityEvent.Invoke ()(0xc7:199) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.UI.Button.Press ()(0x5b:91) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData)(0x27:39) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler,UnityEngine.EventSystems.BaseEventData)(0x3f:63) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.EventSystems.ExecuteEvents.Execute<T_REF> (UnityEngine.GameObject,UnityEngine.EventSystems.BaseEventData,UnityEngine.EventSystems.ExecuteEvents/EventFunction1)(0x25b:603) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData,bool,bool)(0x3c7:967) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents ()(0x133:307) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.EventSystems.StandaloneInputModule.Process ()(0x47:71) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at UnityEngine.EventSystems.EventSystem.Update ()(0x1df:479) 12-10 15:04:58.631 14640 14691 E AndroidRuntime: at System.Object.runtime_invoke_voidthis (object,intptr,intptr,intptr)(Native Method) 12-10 15:04:58.641 1304 15212 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2 12-10 15:04:58.643 1304 15212 D FrameworkEventCollector: recordAppIssue PN: com.digiart2.quizup 12-10 15:04:58.644 1304 4746 W ActivityTaskManager: Force finishing activity com.digiart2.quizup/com.google.firebase.MessagingUnityPlayerActivity ` 12-10 15:04:58.645 1304 3634 D gwy : OS Event: crash

`

12-10 15:04:58.647 1304 4746 D OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{2bd290 token=Token{21be953 ActivityRecord{7a4e542 u0 net.oneplus.launcher/.Launcher t1932}}} pkgName net.oneplus.launcher 12-10 15:04:58.649 1304 4746 D ActivityTrigger: ActivityTrigger activityPauseTrigger 12-10 15:04:58.658 1304 1437 D gwy : OS Event: appuse 12-10 15:04:58.649 1304 4746 D OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{2bd290 token=Token{21be953 ActivityRecord{7a4e542 u0 net.oneplus.launcher/.Launcher t1932}}} pkgName net.oneplus.launcher

`

bhupiister commented 3 years ago

12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:630] native: #02 pc 00066633 /apex/com.android.runtime/lib/bionic/libc.so (sem_wait+100) 12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:630] native: #04 pc 004035e0 /data/app/com.digiart2.quizup-2i0jk1SzvRW0A4b6QlX3AA==/lib/arm/libmonobdwgc-2.0.so (???) 12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:630] native: #10 pc 0047d18c /data/app/com.digiart2.quizup-2i0jk1SzvRW0A4b6QlX3AA==/lib/arm/libmonobdwgc-2.0.so (GC_start_routine+40) 12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:630] | stack=0xc06fa000-0xc06fc000 stackSize=1040KB 12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:630] native: #14 pc 001c00c1 /data/app/com.digiart2.quizup-2i0jk1SzvRW0A4b6QlX3AA==/lib/arm/libunity.so (???) 12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:630] native: #15 pc 0000c876 (???) 12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:630] at com.unity3d.player.UnityPlayer$e$1.handleMessage(unavailable:-1) 12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:638] JNI DETECTED ERROR IN APPLICATION: jstring has wrong type: android.text.SpannableString 12-10 15:09:22.281 15566 15618 F digiart2.quizu: runtime.cc:638] in call to GetStringLength 12-10 15:11:07.632 15896 15896 I digiart2.quizu: Late-enabling -Xcheck:jni 12-10 15:11:07.637 15896 15896 E digiart2.quizu: Not starting debugger since process cannot load the jdwp agent. 12-10 15:11:26.715 15896 15947 F digiart2.quizu: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: jstring has wrong type: android.text.SpannableString 12-10 15:11:26.715 15896 15947 F digiart2.quizu: java_vm_ext.cc:570] in call to GetStringLength 12-10 15:11:26.715 15896 15947 F digiart2.quizu: java_vm_ext.cc:570] from boolean com.unity3d.player.UnityPlayer.nativeRender() 12-10 15:11:26.816 15896 15947 F digiart2.quizu: runtime.cc:630] Runtime aborting... 12-10 15:11:26.816 15896 15947 F digiart2.quizu: runtime.cc:630] Dumping all threads without mutator lock held

I have highlighted the text, is this causing error? One more finding. It works perfectly fine if I use copy command from WhatsApp own button at the top bar. However, if u use the copy command which pops up after selecting the text, it causes the app crash. Also there are two types of pop ups, one that is shown in google specific apps like google keyboard, google sheets ,etc. are crashing it. And the one which are native android one are not crashing.