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

Open an Application using Zebra MX Utility does not work #4435

Closed
acaliaro opened this issue Mar 20, 2020 · 12 comments
Closed

Open an Application using Zebra MX Utility does not work #4435

acaliaro opened this issue Mar 20, 2020 · 12 comments
Assignees
Labels
Area: App Runtime Issues in `libmonodroid.so`. need-info Issues that need more information from the author.

Comments

@acaliaro
Copy link

acaliaro commented Mar 20, 2020

Steps to Reproduce

  1. Create a Xamarin.Android / Xamarin Forms (A) application
  2. Install on a Device
  3. Try to open the A application from a B application using Zebra MX tools

<characteristic type="Profile">
<parm name="ProfileName" value="ExecuteExtension"/>
<parm name="ModifiedDate" value="2020-03-14 18:46:07"/>
<parm name="TargetSystemVersion" value="6.0"/>
<characteristic type="AppMgr" version="5.1">
<parm name="emdk_name" value="LaunchApplication"/>
<parm name="Action" value="LaunchApplication"/>
<parm name="ApplicationName" value="My Application Name"/>


Expected Behavior

The app should open (with the same command, Native apps and System apps opens correctly)

Actual Behavior

The app open but crash:

03-20 18:19:05.272 10349-10349/? E/mono: Unhandled Exception:
    System.TypeInitializationException: The type initializer for 'Android.Runtime.Logger' threw an exception. ---> System.EntryPointNotFoundException: monodroid_get_log_categories assembly:<unknown assembly> type:<unknown type> member:(null)
        at (wrapper managed-to-native) Android.Runtime.Logger.monodroid_get_log_categories()
      at Android.Runtime.Logger..cctor () [0x00000] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
       --- End of inner exception stack trace ---
      at Android.Runtime.AndroidObjectReferenceManager.CreateGlobalReference (Java.Interop.JniObjectReference value) [0x00008] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
      at Java.Interop.JniObjectReference.NewGlobalRef () [0x0000a] in <26521a5118b44c858c385715922b9d5d>:0 
      at Java.Interop.JniRuntime..ctor (Java.Interop.JniRuntime+CreationOptions options) [0x0018e] in <26521a5118b44c858c385715922b9d5d>:0 
      at Android.Runtime.AndroidRuntime..ctor (System.IntPtr jnienv, System.IntPtr vm, System.Boolean allocNewObjectSupported, System.IntPtr classLoader, System.IntPtr classLoader_loadClass) [0x0000d] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
      at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) [0x000e9] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
03-20 18:19:05.272 10349-10349/? E/mono-rt: [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Android.Runtime.Logger' threw an exception. ---> System.EntryPointNotFoundException: monodroid_get_log_categories assembly:<unknown assembly> type:<unknown type> member:(null)
        at (wrapper managed-to-native) Android.Runtime.Logger.monodroid_get_log_categories()
      at Android.Runtime.Logger..cctor () [0x00000] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
       --- End of inner exception stack trace ---
      at Android.Runtime.AndroidObjectReferenceManager.CreateGlobalReference (Java.Interop.JniObjectReference value) [0x00008] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
      at Java.Interop.JniObjectReference.NewGlobalRef () [0x0000a] in <26521a5118b44c858c385715922b9d5d>:0 
      at Java.Interop.JniRuntime..ctor (Java.Interop.JniRuntime+CreationOptions options) [0x0018e] in <26521a5118b44c858c385715922b9d5d>:0 
      at Android.Runtime.AndroidRuntime..ctor (System.IntPtr jnienv, System.IntPtr vm, System.Boolean allocNewObjectSupported, System.IntPtr classLoader, System.IntPtr classLoader_loadClass) [0x0000d] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
      at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) [0x000e9] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
03-20 18:19:05.278 10349-10349/? E/CameraBase: SCANNING dlclose for instance 0x7faea817c8
03-20 18:19:05.279 10349-10349/? E/CameraBase: SCANNING AFTER DLCLOSE
03-20 18:19:05.369 557-557/? I/Zygote: Process 10349 exited cleanly (1)
03-20 18:19:05.374 1153-1954/? I/ActivityManager: Process it.xxx.yyy(pid 10349) has died
03-20 18:19:05.374 1153-1954/? D/ActivityManager: cleanUpApplicationRecord -- 10349
03-20 18:19:05.375 1153-1954/? W/ActivityManager: Force removing ActivityRecord{f862b02 u0 it.xxx.yyy/crc64ae17cfc00a1e9d28.MainActivity t916}: app died, no saved state

I have this crash or other kind of crash... let me know if you need other logs

Version Information

Microsoft Visual Studio Community 2019
Versione 16.5.0
VisualStudio.16.Release/16.5.0+29911.84
Microsoft .NET Framework
Versione 4.8.03752

Edizione installata: Community

Visual C++ 2019 00435-60000-00000-AA409
Microsoft Visual C++ 2019

ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 2019 16.5.236.49856
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.5.236.49856
Per altre informazioni, vedere https://www.asp.net/

Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.4.5000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.5.236.49856
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.4.5000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

Estensione IntelliCode 1.0
Informazioni dettagliate sull'estensione IntelliCode di Visual Studio

Estensioni per Strumenti contenitore di Visual Studio (anteprima) 1.0
Consente di visualizzare, gestire ed eseguire la diagnosi dei contenitori all'interno di Visual Studio.

Extensibility Message Bus 1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents 1.0
Eventi di diagnostica di Fabric

Gestione pacchetti NuGet 5.5.0
Gestione pacchetti NuGet in Visual Studio. Per altre informazioni su NuGet, visitare il sito Web https://docs.nuget.org/

Microsoft Azure HDInsight Azure Node 2.4.5000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.4.5000.0
Language service for Hive query

Microsoft Azure Stream Analytics Language Service 2.4.5000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools per contenitori 1.1
Consente di sviluppare, eseguire e convalidare applicazioni ASP.NET Core nell'ambiente di destinazione. Premere F5 per modificare l'applicazione direttamente in un contenitore senza debug oppure CTRL+F5 per modificare e aggiornare l'app senza ricompilare il contenitore.

Mono Debugging for Visual Studio 16.5.512 (7a72495)
Support for debugging Mono processes with Visual Studio.

Pacchetto di Microsoft Visual Studio VC 1.0
Pacchetto di Microsoft Visual Studio VC

Pacchetto host dell'adattatore di debug di Visual Studio Code 1.0
Livello di interoperabilità per l'hosting degli adattatori di debug di Visual Studio Code in Visual Studio

Procedure guidate di Microsoft Visual C++ 1.0
Procedure guidate di Microsoft Visual C++

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62003.05170
Microsoft SQL Server Data Tools

Strumenti C# 3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
Componenti di C# usati nell'IDE. A seconda del tipo e delle impostazioni del processo, è possibile che venga usata una versione diversa del compilatore.

Strumenti comuni di Azure 1.10
Fornisce servizi comuni da usare con Servizi mobili di Azure e gli strumenti di Microsoft Azure.

Strumenti del Servizio app di Azure versione 3.0.0 16.5.236.49856
Strumenti del Servizio app di Azure versione 3.0.0

Strumenti di Microsoft Azure 2.9
Strumenti di Microsoft Azure per Microsoft Visual Studio 2019 - versione 2.9.30207.1

Strumenti di Microsoft Azure Service Fabric per Visual Studio 16.0
Strumenti di Microsoft Azure Service Fabric per Visual Studio

Strumenti di recapito continuo Microsoft per Visual Studio 0.4
Consente di semplificare la configurazione delle pipeline Azure DevOps direttamente dall'IDE di Visual Studio.

Strumenti di Visual Basic 3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
Componenti di Visual Basic usati nell'IDE. A seconda del tipo e delle impostazioni del processo, è possibile che venga usata una versione diversa del compilatore.

Strumenti TypeScript 16.0.20225.2001
Strumenti TypeScript per Microsoft Visual Studio

StylerPackage Extension 1.0
StylerPackage Visual Stuido Extension Detailed Info

ToolWindowHostedEditor 1.0
Hosting json editor into a tool window

Visual F# Tools 10.8.0.0 per F# 4.7 16.5.0-beta.20104.8+7c4de19faf36647c1ef700e655a52350840c6f03
Microsoft Visual F# Tools 10.8.0.0 per F# 4.7

Visual Studio Tools per contenitori 1.0
Visual Studio Tools per contenitori

Visual Studio Tools per Kubernetes 1.0
Visual Studio Tools per Kubernetes

VisualStudio.DeviceLog 1.0
Informazioni sul pacchetto

VisualStudio.Foo 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.5.000.521 (d16-5@b3ea41e)
Estensione di Visual Studio per consentire lo sviluppo per Xamarin.iOS e Xamarin.Android.

Xamarin Designer 16.5.0.470 (remotes/origin/d16-5@681de3fd6)
Estensione di Visual Studio per abilitare gli strumenti di Xamarin Designer in Visual Studio.

Xamarin Templates 16.5.49 (0904f41)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.2.0.100 (d16-5/988c811)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: c0c5c78
Java.Interop: xamarin/java.interop/d16-5@fc18c54
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-5@9f4ed4b

Xamarin.iOS and Xamarin.Mac SDK 13.14.1.39 (30e8706)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Log File

@acaliaro acaliaro added the Area: App Runtime Issues in `libmonodroid.so`. label Mar 20, 2020
@acaliaro
Copy link
Author

acaliaro commented Mar 20, 2020

This is another kind of error, when I try to start an XF Application on a Zebra Device using MX command.

E/mono: Unhandled Exception:
 System.TypeInitializationException: The type initializer for 'System.Random' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.EntryPointNotFoundException: SystemNative_LChflagsCanSetHiddenFlag assembly:<unknown assembly> type:<unknown type> member:(null)
        at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
      at Interop+Sys..cctor () [0x00000] in <5e602907309a47679d31716bdfe8432e>:0 
       --- End of inner exception stack trace ---
      at Interop.GetRandomBytes (System.Byte* buffer, System.Int32 length) [0x00000] in <5e602907309a47679d31716bdfe8432e>:0 
      at System.Random.GenerateGlobalSeed () [0x00000] in <5e602907309a47679d31716bdfe8432e>:0 
      at System.Random..cctor () [0x00000] in <5e602907309a47679d31716bdfe8432e>:0 
       --- End of inner exception stack trace ---
      at System.Threading.ThreadPoolWorkQueueThreadLocals..ctor (System.Threading.ThreadPoolWorkQueue tpq) [0x0000b] in <5e602907309a47679d31716bdfe8432e>:0 
      at System.Threading.ThreadPoolWorkQueue.EnsureCurrentThreadHasQueue () [0x00007] in <5e602907309a47679d31716bdfe8432e>:0 
      at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00016] in <5e602907309a47679d31716bdfe8432e>:0 
      at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <5e602907309a47679d31716bdfe8432e>:0 

end ends with:

03-20 18:43:16.000 12212-12229/it.xxx.yyyA/OpenGLRenderer: Encountered EGL error 12296 EGL_BAD_DISPLAY during rendering
03-20 18:43:16.000 12212-12229/it.xxx.yyyA/libc: Fatal signal 6 (SIGABRT), code -6 in tid 12229 (RenderThread)
03-20 18:43:16.094 533-533/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 18:43:16.094 533-533/? A/DEBUG: Build fingerprint: 'Zebra/TC51/TC51:6.0.1/01-21-04.1-MG-00/151:user/release-keys'
03-20 18:43:16.094 533-533/? A/DEBUG: Revision: '0'
03-20 18:43:16.094 533-533/? A/DEBUG: ABI: 'arm64'
03-20 18:43:16.095 533-533/? A/DEBUG: pid: 12212, tid: 12229, name: RenderThread  >>> it.xxx.yyy<<<
03-20 18:43:16.095 533-533/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-20 18:43:16.138 533-533/? A/DEBUG: Abort message: 'Encountered EGL error 12296 EGL_BAD_DISPLAY during rendering'
03-20 18:43:16.138 533-533/? A/DEBUG:     x0   0000000000000000  x1   0000000000002fc5  x2   0000000000000006  x3   0000000000000000
03-20 18:43:16.138 533-533/? A/DEBUG:     x4   0000000000000000  x5   0000000000000001  x6   0000000000000000  x7   0000000000000000
03-20 18:43:16.138 533-533/? A/DEBUG:     x8   0000000000000083  x9   0000007faea5c012  x10  0000000000000000  x11  0000007faea5b000
03-20 18:43:16.138 533-533/? A/DEBUG:     x12  0000007faea46090  x13  0000000000000001  x14  0000007f91cd6cd8  x15  0000000000000000
03-20 18:43:16.138 533-533/? A/DEBUG:     x16  0000007fb1c116a8  x17  0000007fb1bd2ccc  x18  0000007faea5b000  x19  0000007f91cd7510
03-20 18:43:16.138 533-533/? A/DEBUG:     x20  0000007f91cd7450  x21  0000000000000002  x22  0000000000000006  x23  000000559854c878
03-20 18:43:16.138 533-533/? A/DEBUG:     x24  000000559854c7c0  x25  00000055985512b0  x26  00000000ffffffff  x27  0000007ff22020f8
03-20 18:43:16.138 533-533/? A/DEBUG:     x28  0000000000001000  x29  0000007f91cd6b90  x30  0000007fb1bd0468
03-20 18:43:16.138 533-533/? A/DEBUG:     sp   0000007f91cd6b90  pc   0000007fb1bd2cd4  pstate 0000000020000000
03-20 18:43:16.152 533-533/? A/DEBUG: backtrace:
03-20 18:43:16.152 533-533/? A/DEBUG:     #00 pc 000000000006acd4  /system/lib64/libc.so (tgkill+8)
03-20 18:43:16.152 533-533/? A/DEBUG:     #01 pc 0000000000068464  /system/lib64/libc.so (pthread_kill+68)
03-20 18:43:16.152 533-533/? A/DEBUG:     #02 pc 00000000000212b8  /system/lib64/libc.so (raise+28)
03-20 18:43:16.152 533-533/? A/DEBUG:     #03 pc 000000000001ba58  /system/lib64/libc.so (abort+60)
03-20 18:43:16.152 533-533/? A/DEBUG:     #04 pc 000000000000d000  /system/lib64/libcutils.so (__android_log_assert+236)
03-20 18:43:16.152 533-533/? A/DEBUG:     #05 pc 00000000000283d4  /system/lib64/libhwui.so
03-20 18:43:16.152 533-533/? A/DEBUG:     #06 pc 0000000000024b04  /system/lib64/libhwui.so
03-20 18:43:16.152 533-533/? A/DEBUG:     #07 pc 000000000002706c  /system/lib64/libhwui.so
03-20 18:43:16.152 533-533/? A/DEBUG:     #08 pc 000000000002b3f8  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+124)
03-20 18:43:16.152 533-533/? A/DEBUG:     #09 pc 00000000000167b4  /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+208)
03-20 18:43:16.152 533-533/? A/DEBUG:     #10 pc 0000000000092fbc  /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+96)
03-20 18:43:16.152 533-533/? A/DEBUG:     #11 pc 0000000000016004  /system/lib64/libutils.so
03-20 18:43:16.152 533-533/? A/DEBUG:     #12 pc 00000000000678b4  /system/lib64/libc.so (_ZL15__pthread_startPv+52)
03-20 18:43:16.152 533-533/? A/DEBUG:     #13 pc 000000000001c604  /system/lib64/libc.so (__start_thread+16)
03-20 18:43:16.498 533-533/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_06
03-20 18:43:16.498 533-533/? E/DEBUG: AM write failed: Broken pipe

@grendello
Copy link
Contributor

@acaliaro Hi, can you create both application A and B and attach them here (minimal code to reproduce the issue)? I'd like to examine the exact code you're using as I don't see anything that obviously stands out as the cause of the crashes (I have my suspicions, but they are just that - suspicions). Thanks!

@grendello grendello added the need-info Issues that need more information from the author. label Mar 23, 2020
@acaliaro
Copy link
Author

@acaliaro Hi, can you create both application A and B and attach them here (minimal code to reproduce the issue)? I'd like to examine the exact code you're using as I don't see anything that obviously stands out as the cause of the crashes (I have my suspicions, but they are just that - suspicions). Thanks!

Hi @grendello

https://github.com/acaliaro/ZebraLaunchAppWithMx

here you can find a NATIVE Android Java app that use MX. Obviously you must have a Zebra device to test it.

You will find a Entry where you should insert the app name (you can find it in Settings / Apps....).
If you launch apps like "Calendar", you don't have problems. If you launch some Xamarin.Android or Xamarin.Forms apps, you have problems I have already post.

I am not able to attach the B app because they are App in productions… but I think you have a lot of apps that you can try… I really don't know which could be the problem because I have very complex apps that does not have the problem, and simpler apps that have the problem.

Let me know if you need other info or help

Thanks
Alessandro

@jonpryor
Copy link
Member

I believe that we'll need more adb logcat output, because the System.EntryPointNotFoundException strongly implies that "normal" process startup has not occurred -- libmonodroid.so wasn't loaded, JNIEnv.Initialize() wasn't invoked, etc.

Please do the following:

  1. On a computer attached to your Zebra-enabled Android device, enable all Xamarin.Android logging:

    adb shell setprop debug.mono.log all
    
  2. Begin capturing logcat:

    adb logcat > log.txt
    
  3. Run your test on your Zebra-enabled Android device.

  4. Attach log.txt to this issue.

If you feel a need to filter the contents of log.txt, we would like all messages containing [Mm]ono and monodroid, e.g.

W monodroid: Creating public update directory: `/data/user/0/Xamarin.Android.JcwGen_Tests/files/.__override__`
W monodroid-assembly: /data/app/Xamarin.Android.JcwGen_Tests-J3cc3H709TGW14-E7dbAZw==/base.apk entry: AndroidManifest.xml
D Mono    : Image addref mscorlib[0xf4dbb440] (asmctx DEFAULT) -> mscorlib.dll[0xf4d33300]: 2
D Mono    : Found as 'monodroid_get_log_categories'
I mono-stdout: [Time:            1566871809000]

Offhand, this "feels like" Issue #1950 / https://bugzilla.xamarin.com/show_bug.cgi?id=51940 in which apps don't startup correctly when //service[@android:isolatedProcess='true'], because "normal process startup" doesn't occur. It's hard to say without additional logcat.

@acaliaro
Copy link
Author

Ok @jonpryor , I will try to send this logcat

@acaliaro
Copy link
Author

log.txt

let me know @jonpryor

Thanks

@acaliaro
Copy link
Author

@jonpryor

adb shell setprop debug.mono.log all

how can I return to a "default" value?

@grendello
Copy link
Contributor

@acaliaro This should work to reset the property value:

adb shell setprop debug.mono.log "''"

@grendello
Copy link
Contributor

@acaliaro Would it be possible for you to attach the failing application's .apk here (you would need to rename it to .zip)? If not, could you alternatively mail it to me (or upload somewhere and send me a link) at my GitHub email (click on my avatar, the address is there)? Also, can you try removing the bin and obj directories of the failing solution and rebuild the entire application from scratch? The reason I'm asking all this is that the log you provided contains this failure:

03-24 07:35:29.841 14025 14025 I monodroid-assembly: open_from_bundles: loaded assembly: 0x5598231570
03-24 07:35:29.841 14025 14025 D Mono    : Assembly Ref addref Mono.Android[0x55981d9140] -> System[0x5598231570]: 2
03-24 07:35:29.843 14025 14025 D Mono    : Requesting loading reference 0 (of 5) of System.dll
03-24 07:35:29.843 14025 14025 D Mono    : Loading reference 0 of System.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
03-24 07:35:29.843 14025 14025 D Mono    : Assembly Ref addref System[0x5598231570] -> mscorlib[0x5598136cc0]: 4
03-24 07:35:29.846 14025 14025 D Mono    : DllImport searching in: '__Internal' ('(null)').
03-24 07:35:29.846 14025 14025 D Mono    : Searching for 'monodroid_timing_stop'.
03-24 07:35:29.846 14025 14025 D Mono    : Probing 'monodroid_timing_stop'.
03-24 07:35:29.846 14025 14025 D Mono    : Could not find 'monodroid_timing_stop' due to 'Could not find symbol 'monodroid_timing_stop'.'.
03-24 07:35:29.846 14025 14025 D Mono    : Probing 'monodroid_timing_stopA'.
03-24 07:35:29.846 14025 14025 D Mono    : Could not find 'monodroid_timing_stopA' due to 'Could not find symbol 'monodroid_timing_stopA'.'.
03-24 07:35:29.846 14025 14025 D Mono    : Probing 'monodroid_timing_stop'.
03-24 07:35:29.846 14025 14025 D Mono    : Could not find 'monodroid_timing_stop' due to 'Could not find symbol 'monodroid_timing_stop'.'.
03-24 07:35:29.846 14025 14025 D Mono    : Probing 'monodroid_timing_stopA'.
03-24 07:35:29.846 14025 14025 D Mono    : Could not find 'monodroid_timing_stopA' due to 'Could not find symbol 'monodroid_timing_stopA'.'.
03-24 07:35:29.848 14025 14025 D Mono    : DllImport searching in: '__Internal' ('(null)').
03-24 07:35:29.848 14025 14025 D Mono    : Searching for 'monodroid_timing_start'.
03-24 07:35:29.848 14025 14025 D Mono    : Probing 'monodroid_timing_start'.
03-24 07:35:29.848 14025 14025 D Mono    : Could not find 'monodroid_timing_start' due to 'Could not find symbol 'monodroid_timing_start'.'.
03-24 07:35:29.848 14025 14025 D Mono    : Probing 'monodroid_timing_startA'.
03-24 07:35:29.848 14025 14025 D Mono    : Could not find 'monodroid_timing_startA' due to 'Could not find symbol 'monodroid_timing_startA'.'.
03-24 07:35:29.848 14025 14025 D Mono    : Probing 'monodroid_timing_start'.
03-24 07:35:29.848 14025 14025 D Mono    : Could not find 'monodroid_timing_start' due to 'Could not find symbol 'monodroid_timing_start'.'.
03-24 07:35:29.848 14025 14025 D Mono    : Probing 'monodroid_timing_startA'.
03-24 07:35:29.848 14025 14025 D Mono    : Could not find 'monodroid_timing_startA' due to 'Could not find symbol 'monodroid_timing_startA'.'.
03-24 07:35:29.946 14025 14025 E mono    : 
03-24 07:35:29.946 14025 14025 E mono    : Unhandled Exception:
03-24 07:35:29.946 14025 14025 E mono    : System.EntryPointNotFoundException: monodroid_timing_start assembly:<unknown assembly> type:<unknown type> member:(null)
03-24 07:35:29.946 14025 14025 E mono    :   at (wrapper managed-to-native) Android.Runtime.JNIEnv.monodroid_timing_start(string)
03-24 07:35:29.946 14025 14025 E mono    :   at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) [0x0001c] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
03-24 07:35:29.948 14025 14025 E mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.EntryPointNotFoundException: monodroid_timing_start assembly:<unknown assembly> type:<unknown type> member:(null)
03-24 07:35:29.948 14025 14025 E mono-rt :   at (wrapper managed-to-native) Android.Runtime.JNIEnv.monodroid_timing_start(string)
03-24 07:35:29.948 14025 14025 E mono-rt :   at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) [0x0001c] in <4ccdb3137d974856b786e1aeebbfbab6>:0 

And the monodroid_timing_{start,stop} functions were added in this commit. You setting the debug.mono.log property to all enabled timing measurement from the managed land, which p/invokes those functions. This makes me think that your APK, somehow, has some older version of the native Xamarin.Android runtime but a newer version of the Mono.Android assembly. To check whether this is the case I need to look at the files inside the APK. A full rebuild (after removing bin and obj directories) will, in turn, ascertain that you are using everything from your current version of Xamarin.Android.

@acaliaro
Copy link
Author

@acaliaro This should work to reset the property value:
adb shell setprop debug.mono.log "''"

thanks @grendello

@acaliaro
Copy link
Author

@acaliaro Would it be possible for you to attach the failing application's .apk here (you would need to rename it to .zip)? If not, could you alternatively mail it to me (or upload somewhere and send me a link) at my GitHub email (click on my avatar, the address is there)? Also, can you try removing the bin and obj directories of the failing solution and rebuild the entire application from scratch? The reason I'm asking all this is that the log you provided contains this failure:
03-24 07:35:29.841 14025 14025 I monodroid-assembly: open_from_bundles: loaded assembly: 0x5598231570
03-24 07:35:29.841 14025 14025 D Mono : Assembly Ref addref Mono.Android[0x55981d9140] -> System[0x5598231570]: 2
03-24 07:35:29.843 14025 14025 D Mono : Requesting loading reference 0 (of 5) of System.dll
03-24 07:35:29.843 14025 14025 D Mono : Loading reference 0 of System.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
03-24 07:35:29.843 14025 14025 D Mono : Assembly Ref addref System[0x5598231570] -> mscorlib[0x5598136cc0]: 4
03-24 07:35:29.846 14025 14025 D Mono : DllImport searching in: '__Internal' ('(null)').
03-24 07:35:29.846 14025 14025 D Mono : Searching for 'monodroid_timing_stop'.
03-24 07:35:29.846 14025 14025 D Mono : Probing 'monodroid_timing_stop'.
03-24 07:35:29.846 14025 14025 D Mono : Could not find 'monodroid_timing_stop' due to 'Could not find symbol 'monodroid_timing_stop'.'.
03-24 07:35:29.846 14025 14025 D Mono : Probing 'monodroid_timing_stopA'.
03-24 07:35:29.846 14025 14025 D Mono : Could not find 'monodroid_timing_stopA' due to 'Could not find symbol 'monodroid_timing_stopA'.'.
03-24 07:35:29.846 14025 14025 D Mono : Probing 'monodroid_timing_stop'.
03-24 07:35:29.846 14025 14025 D Mono : Could not find 'monodroid_timing_stop' due to 'Could not find symbol 'monodroid_timing_stop'.'.
03-24 07:35:29.846 14025 14025 D Mono : Probing 'monodroid_timing_stopA'.
03-24 07:35:29.846 14025 14025 D Mono : Could not find 'monodroid_timing_stopA' due to 'Could not find symbol 'monodroid_timing_stopA'.'.
03-24 07:35:29.848 14025 14025 D Mono : DllImport searching in: '__Internal' ('(null)').
03-24 07:35:29.848 14025 14025 D Mono : Searching for 'monodroid_timing_start'.
03-24 07:35:29.848 14025 14025 D Mono : Probing 'monodroid_timing_start'.
03-24 07:35:29.848 14025 14025 D Mono : Could not find 'monodroid_timing_start' due to 'Could not find symbol 'monodroid_timing_start'.'.
03-24 07:35:29.848 14025 14025 D Mono : Probing 'monodroid_timing_startA'.
03-24 07:35:29.848 14025 14025 D Mono : Could not find 'monodroid_timing_startA' due to 'Could not find symbol 'monodroid_timing_startA'.'.
03-24 07:35:29.848 14025 14025 D Mono : Probing 'monodroid_timing_start'.
03-24 07:35:29.848 14025 14025 D Mono : Could not find 'monodroid_timing_start' due to 'Could not find symbol 'monodroid_timing_start'.'.
03-24 07:35:29.848 14025 14025 D Mono : Probing 'monodroid_timing_startA'.
03-24 07:35:29.848 14025 14025 D Mono : Could not find 'monodroid_timing_startA' due to 'Could not find symbol 'monodroid_timing_startA'.'.
03-24 07:35:29.946 14025 14025 E mono :
03-24 07:35:29.946 14025 14025 E mono : Unhandled Exception:
03-24 07:35:29.946 14025 14025 E mono : System.EntryPointNotFoundException: monodroid_timing_start assembly: type: member:(null)
03-24 07:35:29.946 14025 14025 E mono : at (wrapper managed-to-native) Android.Runtime.JNIEnv.monodroid_timing_start(string)
03-24 07:35:29.946 14025 14025 E mono : at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) [0x0001c] in <4ccdb3137d974856b786e1aeebbfbab6>:0
03-24 07:35:29.948 14025 14025 E mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.EntryPointNotFoundException: monodroid_timing_start assembly: type: member:(null)
03-24 07:35:29.948 14025 14025 E mono-rt : at (wrapper managed-to-native) Android.Runtime.JNIEnv.monodroid_timing_start(string)
03-24 07:35:29.948 14025 14025 E mono-rt : at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) [0x0001c] in <4ccdb3137d974856b786e1aeebbfbab6>:0

And the monodroid_timing_{start,stop} functions were added in this commit. You setting the debug.mono.log property to all enabled timing measurement from the managed land, which p/invokes those functions. This makes me think that your APK, somehow, has some older version of the native Xamarin.Android runtime but a newer version of the Mono.Android assembly. To check whether this is the case I need to look at the files inside the APK. A full rebuild (after removing bin and obj directories) will, in turn, ascertain that you are using everything from your current version of Xamarin.Android.

ok @grendello , I mail to you the apk

@acaliaro
Copy link
Author

Hi guys. Good news. The problem seems solved if I install the APK. Tests I have made are relative to launch applications deployed to the device using Visual Studio (so in "debug" mode). Probably sometimes Visual Studio does not deploy all correct runtimes. I have uninstalled the app and installed the APK, and the app is launched correctly.

I think this can be closed… I will reopen it if I will have some problems also with app installed from APK.
Thanks for the help
Alessandro

@ghost ghost locked as resolved and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App Runtime Issues in `libmonodroid.so`. need-info Issues that need more information from the author.
Projects
None yet
Development

No branches or pull requests

4 participants