dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 530 forks source link

[Bug] hybrid aot crash on startup in android project #4115

Closed PureWeen closed 6 months ago

PureWeen commented 4 years ago

Original Issue https://github.com/xamarin/Xamarin.Forms/issues/8117

Description

Starting an android application made with xamarin.forms with hybrid aot and llvm enabled crashes at startup. The configuration worked with previous versions of VisualStudio. The same happens when building the application on a pipeline hosted on azure.

Steps to Reproduce

https://github.com/xamarin/Xamarin.Forms/files/3754036/App1.zip

Create an empty Xamarin.Forms project

Put the following configuration in the andorid csproj for Release:

    <DebugSymbols>false</DebugSymbols>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <AndroidManagedSymbols>true</AndroidManagedSymbols>
    <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
    <AndroidLinkMode>None</AndroidLinkMode>
    <AndroidSupportedAbis>arm64-v8a</AndroidSupportedAbis>
    <JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
    <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
    <AotAssemblies>true</AotAssemblies>
    <EnableLLVM>true</EnableLLVM>
    <AndroidAotMode>Hybrid</AndroidAotMode>
    <BundleAssemblies>true</BundleAssemblies>
    <EnableProguard>true</EnableProguard>
    <AndroidAotAdditionalArguments>nodebug,no-write-symbols</AndroidAotAdditionalArguments>
    <AndroidCreatePackagePerAbi>true</AndroidCreatePackagePerAbi>
    <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
    <AndroidTlsProvider>btls</AndroidTlsProvider>

Build, deply and run the application.

Expected Behavior

The application opens correctly.

Actual Behavior

The application crashes. Here is the log:

`10-21 11:21:59.131 29642 29667 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
10-21 11:21:59.131 29642 29667 I iGraphics: [0020080c] pn: com.companyname.app1, p: 29642
10-21 11:21:59.131 29642 29667 I iGraphics: [0030080c] no spt app: com.companyname.app1
10-21 11:21:59.131 29642 29667 I OpenGLRenderer: Initialized EGL, version 1.4, mEglDisplay 0x1
10-21 11:21:59.131 29642 29667 D OpenGLRenderer: Swap behavior 2
10-21 11:21:59.132   692  3178 E BufferQueueProducer: [] mConsumerName == NULL!!!!!!
10-21 11:21:59.135   651  8946 I chatty  : uid=1000(system) HwBinder:651_3 expire 2 lines
10-21 11:21:59.135   692  3178 E BufferQueueProducer: [] mConsumerName == NULL!!!!!!
10-21 11:21:59.139 29642 29667 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
10-21 11:21:59.152  1240  1473 I chatty  : uid=1000(system) AlarmManager expire 6 lines
10-21 11:21:59.155 29642 29642 W ompanyname.app: JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.CellRenderer_RendererHolder
10-21 11:21:59.164 29642 29642 I MonoDroid: UNHANDLED EXCEPTION:
10-21 11:21:59.167 29642 29642 I MonoDroid: System.InvalidProgramException: Invalid IL code in App1.ViewModels.BaseViewModel:SetProperty<bool> (bool&,bool,string,System.Action): IL_0000: ret 
10-21 11:21:59.167 29642 29642 I MonoDroid:
10-21 11:21:59.167 29642 29642 I MonoDroid:
10-21 11:21:59.167 29642 29642 I MonoDroid:   at App1.ViewModels.BaseViewModel.set_IsBusy (System.Boolean value) <0x707e0cbe8c + 0x0005c> in <725878a204a34ea3bfd2f9547261f64b>:0
10-21 11:21:59.167 29642 29642 I MonoDroid:   at App1.ViewModels.ItemsViewModel.ExecuteLoadItemsCommand () [0x0001e] in <725878a204a34ea3bfd2f9547261f64b>:0
10-21 11:21:59.167 29642 29642 I MonoDroid:   at App1.ViewModels.ItemsViewModel.<.ctor>b__8_0 () [0x00062] in <725878a204a34ea3bfd2f9547261f64b>:0
10-21 11:21:59.167 29642 29642 I MonoDroid:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) <0x707c2a9420 + 0x0007b> in <6de48997d0c0445dbea8d4d83492d8c6>:0
10-21 11:21:59.167 29642 29642 I MonoDroid:   at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () <0x7078fc60c4 + 0x0003b> in <11a340ccc8de43f09c97400139266ef5>:0
10-21 11:21:59.167 29642 29642 I MonoDroid:   at Java.Lang.Thread+RunnableImplementor.Run () <0x707905234c + 0x00067> in <11a340ccc8de43f09c97400139266ef5>:0
10-21 11:21:59.167 29642 29642 I MonoDroid:   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) <0x7078bf95bc + 0x0007b> in <11a340ccc8de43f09c97400139266ef5>:0
10-21 11:21:59.167 29642 29642 I MonoDroid:   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.69(intptr,intptr)
10-21 11:21:59.168 29642 29642 W ompanyname.app: JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
10-21 11:21:59.168 29642 29642 D AndroidRuntime: Shutting down VM
10-21 11:21:59.170 29642 29642 E AndroidRuntime: FATAL EXCEPTION: main
10-21 11:21:59.170 29642 29642 E AndroidRuntime: Process: com.companyname.app1, PID: 29642
10-21 11:21:59.170 29642 29642 E AndroidRuntime: android.runtime.JavaProxyThrowable: System.InvalidProgramException: Invalid IL code in App1.ViewModels.BaseViewModel:SetProperty<bool> (bool&,bool,string,System.Action): IL_0000: ret
10-21 11:21:59.170 29642 29642 E AndroidRuntime:
10-21 11:21:59.170 29642 29642 E AndroidRuntime:
10-21 11:21:59.170 29642 29642 E AndroidRuntime:   at App1.ViewModels.BaseViewModel.set_IsBusy (System.Boolean value) <0x707e0cbe8c + 0x0005c> in <725878a204a34ea3bfd2f9547261f64b>:0
10-21 11:21:59.170 29642 29642 E AndroidRuntime:   at App1.ViewModels.ItemsViewModel.ExecuteLoadItemsCommand () [0x0001e] in <725878a204a34ea3bfd2f9547261f64b>:0
10-21 11:21:59.170 29642 29642 E AndroidRuntime:   at App1.ViewModels.ItemsViewModel.<.ctor>b__8_0 () [0x00062] in <725878a204a34ea3bfd2f9547261f64b>:0
10-21 11:21:59.170 29642 29642 E AndroidRuntime:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) <0x707c2a9420 + 0x0007b> in <6de48997d0c0445dbea8d4d83492d8c6>:0
10-21 11:21:59.170 29642 29642 E AndroidRuntime:   at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () <0x7078fc60c4 + 0x0003b> in <11a340ccc8de43f09c97400139266ef5>:0
10-21 11:21:59.170 29642 29642 E AndroidRuntime:   at Java.Lang.Thread+RunnableImplementor.Run () <0x707905234c + 0x00067> in <11a340ccc8de43f09c97400139266ef5>:0
10-21 11:21:59.170 29642 29642 E AndroidRuntime:   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) <0x7078bf95bc + 0x0007b> in <11a340ccc8de43f09c97400139266ef5>:0
10-21 11:21:59.170 29642 29642 E AndroidRuntime:   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.69(intptr,intptr)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at mono.java.lang.RunnableImplementor.n_run(Native Method)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:907)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:105)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:216)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7625)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
10-21 11:21:59.170 29642 29642 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
10-21 11:21:59.173   835  3202 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.174   835  3202 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.174   835  9898 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.175   835  9898 I chatty  : uid=0(root) RFD_TASK2 identical 11 lines
10-21 11:21:59.175 29642 29642 I Process : Sending signal. PID: 29642 SIG: 9
10-21 11:21:59.181   835  9901 I chatty  : uid=0(root) RFD_TASK3 expire 107 lines
10-21 11:21:59.189   803  1438 I chatty  : uid=0(root) SystemHandler expire 10 lines
10-21 11:21:59.191  1240  3702 I chatty  : uid=1000(system) Binder:1240_10 expire 1 line
10-21 11:21:59.192  1240  1240 I chatty  : uid=1000 system_server expire 81 lines
10-21 11:21:59.198   803  1438 E dubaid  : [SystemHandler.cpp] onPartialWakelockReleaseMessage# Already released, lock: 133896067
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532311): avc: denied { getattr } for path="/vendor/bin/32e6a847-ac89-4f81-8a13-f4ae50451d7f.sec" dev="dm-1" ino=256 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532312): avc: denied { getattr } for path="/vendor/bin/335129cd-41fa-4b53-9797-5ccb202a52d4.sec" dev="dm-1" ino=1024 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532313): avc: denied { getattr } for path="/vendor/bin/4382f063-a6c3-485f-8786-e275512bd2ad.sec" dev="dm-1" ino=63 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532314): avc: denied { getattr } for path="/vendor/bin/4ae7ba51-2810-4cee-abbe-a42307b4ace3.sec" dev="dm-1" ino=121 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532315): avc: denied { getattr } for path="/vendor/bin/54ad737b-d84a-46bd-b993-1a90883f66f7.sec" dev="dm-1" ino=8832 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532316): avc: denied { getattr } for path="/vendor/bin/6c8cf255-ca98-439e-a98e-ade64022ecb6.sec" dev="dm-1" ino=9856 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532317): avc: denied { getattr } for path="/vendor/bin/859703f3-3cc5-4e88-b263-08f9ce82e3d0.sec" dev="dm-1" ino=349 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532318): avc: denied { getattr } for path="/vendor/bin/86310d18-5659-47c9-b212-841a3ca4f814.sec" dev="dm-1" ino=8874 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532319): avc: denied { getattr } for path="/vendor/bin/866d6c6d-df3c-4cfd-b892-32d1768dd018.sec" dev="dm-1" ino=8917 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532320): avc: denied { getattr } for path="/vendor/bin/868ccafb-794b-46c6-b5c4-9f1462de4e02.sec" dev="dm-1" ino=44416 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532321): avc: denied { getattr } for path="/vendor/bin/883890ba-3ef8-4f0b-9c02-f5874acbf2ff.sec" dev="dm-1" ino=45056 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532322): avc: denied { getattr } for path="/vendor/bin/993e26b8-0273-408e-98d3-60c997c37121.sec" dev="dm-1" ino=45096 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532323): avc: denied { getattr } for path="/vendor/bin/9b17660b-8968-4eed-917e-dd32379bd548.sec" dev="dm-1" ino=68352 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532324): avc: denied { getattr } for path="/vendor/bin/CameraDaemon" dev="dm-1" ino=351 scontext=u:r:logserver:s0 tcontext=u:object_r:hal_camera_default_exec:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532325): avc: denied { getattr } for path="/vendor/bin/a3d05777-b0ec-43b0-8887-a7f93697830a.sec" dev="dm-1" ino=70272 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532326): avc: denied { getattr } for path="/vendor/bin/activity_recognition_service" dev="dm-1" ino=371 scontext=u:r:logserver:s0 tcontext=u:object_r:activityrecognition_exec:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532327): avc: denied { getattr } for path="/vendor/bin/aptouch_daemon" dev="dm-1" ino=1132 scontext=u:r:logserver:s0 tcontext=u:object_r:aptouch_daemon_exec:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532328): avc: denied { getattr } for path="/vendor/bin/atcmdserver" dev="dm-1" ino=70335 scontext=u:r:logserver:s0 tcontext=u:object_r:atcmdserver_exec:s0 tclass=file permissive=0
10-21 11:21:59.196   835   835 W RFD_TASK3: type=1400 audit(0.0:532329): avc: denied { getattr } for path="/vendor/bin/b4b71581-add2-e89f-d536-f35436dc7973.sec" dev="dm-1" ino=77952 scontext=u:r:logserver:s0 tcontext=u:object_r:vendor_ca_file:s0 tclass=file permissive=0
10-21 11:21:59.203   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.223   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.224   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.225  1240  6602 I chatty  : uid=1000(system) Binder:1240_19 expire 7 lines
10-21 11:21:59.225  1240  6602 I chatty  : uid=1000(system) Binder:1240_19 expire 4 lines
10-21 11:21:59.226   630   630 I Zygote  : Process 29642 exited due to signal (9)
10-21 11:21:59.226   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.229  2009  2559 I chatty  : uid=1000(system) EmcomThread expire 21 lines
10-21 11:21:59.229  2009  2025 I BoosterSwitchP: notifyUidState do nothing
10-21 11:21:59.229  2009  2025 I DeepNoDisturbP: notifyUidState
10-21 11:21:59.229  2009  2025 I BrowserChrP: notifyUidState
10-21 11:21:59.230   798   871 D iTouchService: itouch currentPackageName=com.companyname.app1
10-21 11:21:59.230   798   871 D iTouchService: itouch appType=-1 appState=0 gameMode=2
10-21 11:21:59.230   798   871 D iTouchService: g_itouch_reader_monitor empty
10-21 11:21:59.230   798   871 D iTouchService: g_itouch_reader_monitor Monitor::isReaderMonitorEnable()=0
10-21 11:21:59.230   798   871 D iTouchService: itouch getCurrentParmID tempPkg=com.companyname.xxx
10-21 11:21:59.230   798   871 D iTouchService: itouch:app com.companyname.app1 is  not game app
10-21 11:21:59.230   798   871 D iTouchService: itouch:styluspen_switch is disable
10-21 11:21:59.230   798   871 D iTouchService: itouch:currentAppTypeName =|UNKNOWN|
10-21 11:21:59.232   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.241   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.242  2118  2152 I chatty  : uid=10063(com.huawei.android.launcher) Binder:2118_2 expire 4 lines
10-21 11:21:59.242   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.244  1240  3435 I chatty  : uid=1000(system) Binder:1240_E expire 9 lines
10-21 11:21:59.244   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.248  1240  1275 I chatty  : uid=1000(system) android.display expire 1 line
10-21 11:21:59.248   835  9901 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.248   835  9919 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.248   835  9919 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.248   835  9919 I iMonitor: create: 0
10-21 11:21:59.248   835  9919 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.248   835  9919 I iMonitor: send: 0
10-21 11:21:59.248   835  9919 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.248  1240  1265 I chatty  : uid=1000(system) android.ui expire 16 lines
10-21 11:21:59.249  2009  3259 I HidataAppQoeP: foregroundUidRemove uid: 10877 name: com.companyname.app1
10-21 11:21:59.249  2009  3259 I HidataAppQoeP: sendKernelAppUid, Uid = 0, period = 0 name = null
10-21 11:21:59.249   835  9919 E iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
10-21 11:21:59.249  1240  1497 I chatty  : uid=1000(system) NetdConnector expire 2 lines
10-21 11:21:59.259  2082  2370 I chatty  : uid=1000(system) Binder:2082_4 expire 1 line
10-21 11:21:59.259 13269 13282 I HiSearch19.11.3.304: [LauncherOverlayService]: LAUNCHER_INTERACTION from launcher and invoke id = -111
10-21 11:21:59.259 13269 13282 I HiSearch19.11.3.304: [LauncherOverlayService]: isOverlayClosed = true
10-21 11:21:59.259 13269 13282 I HiSearch19.11.3.304: [LauncherOverlayService]: LAUNCHER_INTERACTION from launcher and invoke, overlay closed, return.
10-21 11:21:59.267   651  2471 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x200000001,btStrd=5888,size=18661376,pid=651
10-21 11:21:59.267   651  2471 I GRALLOC :       yuv=2,w=1440,h=3120,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.267   651  2471 I GRALLOC :       iova_size=18661376,conUsg=0x900,proUsg=0x900,   strd=1472,[afbc]HdrStrd=1472 PyldStrd=94208 Scrmbl=2,ionhnd = 1
10-21 11:21:59.268  1240  1741 I chatty  : uid=1000(system) RenderThread expire 6 lines
10-21 11:21:59.268  1240  1484 I chatty  : uid=1000(system) GestureNavManag expire 2 lines
10-21 11:21:59.271   651  2471 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x200000001,btStrd=5888,size=18661376,pid=651
10-21 11:21:59.271   651  2471 I GRALLOC :       yuv=2,w=1440,h=3120,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.271   651  2471 I GRALLOC :       iova_size=18661376,conUsg=0x900,proUsg=0x900,   strd=1472,[afbc]HdrStrd=1472 PyldStrd=94208 Scrmbl=2,ionhnd = 1
10-21 11:21:59.273 20385 20466 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
10-21 11:21:59.274  1240  1276 I chatty  : uid=1000(system) HwGameAssistant expire 1 line
10-21 11:21:59.274  1240  1262 I chatty  : uid=1000(system) HwActivityManag expire 1 line
10-21 11:21:59.275  2009  3259 I chatty  : uid=1000(system) DollieAdapter expire 2 lines
10-21 11:21:59.275  1796  1796 I HwNavigationBarView: updateAssistantButtonInGuestureMode(), vis=true,isGestureNavEnable=true
10-21 11:21:59.275  3510  4612 I AppLifeChangeSensor:  CAWARENESS: activityResumed componentName = ComponentInfo{com.huawei.android.launcher/com.huawei.android.launcher.drawer.DrawerLauncher}
10-21 11:21:59.278   651  8946 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x200000001,btStrd=5888,size=18661376,pid=651
10-21 11:21:59.278   651  8946 I GRALLOC :       yuv=2,w=1440,h=3120,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.278   651  8946 I GRALLOC :       iova_size=18661376,conUsg=0x900,proUsg=0x900,   strd=1472,[afbc]HdrStrd=1472 PyldStrd=94208 Scrmbl=2,ionhnd = 1
10-21 11:21:59.283   651  2471 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x200000001,btStrd=5888,size=18661376,pid=651
10-21 11:21:59.283   651  2471 I GRALLOC :       yuv=2,w=1440,h=3120,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.283   651  2471 I GRALLOC :       iova_size=18661376,conUsg=0xb00,proUsg=0xb00,   strd=1472,[afbc]HdrStrd=1472 PyldStrd=94208 Scrmbl=2,ionhnd = 1
10-21 11:21:59.288   651   952 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x200000001,btStrd=5888,size=18661376,pid=651
10-21 11:21:59.288   651   952 I GRALLOC :       yuv=2,w=1440,h=3120,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.288   651   952 I GRALLOC :       iova_size=18661376,conUsg=0x900,proUsg=0x900,   strd=1472,[afbc]HdrStrd=1472 PyldStrd=94208 Scrmbl=2,ionhnd = 1
10-21 11:21:59.294   651   952 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x200000001,btStrd=5888,size=18661376,pid=651
10-21 11:21:59.294   651   952 I GRALLOC :       yuv=2,w=1440,h=3120,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.294   651   952 I GRALLOC :       iova_size=18661376,conUsg=0xb00,proUsg=0xb00,   strd=1472,[afbc]HdrStrd=1472 PyldStrd=94208 Scrmbl=2,ionhnd = 1
10-21 11:21:59.295   651  2471 I GRALLOC : getCallingPid=1240, shrFd=34,fmt=0x1,intFmt=0x200000001,btStrd=3072,size=4894720,pid=651
10-21 11:21:59.295   651  2471 I GRALLOC :       yuv=2,w=720,h=1560,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.295   651  2471 I GRALLOC :       iova_size=4894720,conUsg=0x100,proUsg=0x100,    strd=768,[afbc]HdrStrd=768 PyldStrd=49152 Scrmbl=2,ionhnd = 2
10-21 11:21:59.304   651  2471 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x200000001,btStrd=5888,size=18661376,pid=651
10-21 11:21:59.304   651  2471 I GRALLOC :       yuv=2,w=1440,h=3120,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.304   651  2471 I GRALLOC :       iova_size=18661376,conUsg=0xb00,proUsg=0xb00,   strd=1472,[afbc]HdrStrd=1472 PyldStrd=94208 Scrmbl=2,ionhnd = 1
10-21 11:21:59.308  1796  1814 I CommandQueue: updateBarBgColor
10-21 11:21:59.308  1796  1814 D CommandQueue: CommandQueue, setBarBackgroundColor
10-21 11:21:59.308  1796  1796 D TintManager: navigationBarIconTint=99ffffff
10-21 11:21:59.317   651  2471 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x1,btStrd=256,size=602112,pid=651
10-21 11:21:59.317   651  2471 I GRALLOC :       yuv=2,w=64,h=2340,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.317   651  2471 I GRALLOC :       iova_size=602112,conUsg=0xb00,proUsg=0xb00,     strd=64,[afbc]HdrStrd=0 PyldStrd=0 Scrmbl=0,ionhnd = 1
10-21 11:21:59.320   651  2471 I GRALLOC : getCallingPid=692, shrFd=11,fmt=0x1,intFmt=0x1,btStrd=256,size=602112,pid=651
10-21 11:21:59.320   651  2471 I GRALLOC :       yuv=2,w=64,h=2340,Stride u=0 v=0,offset u=0 v=0
10-21 11:21:59.320   651  2471 I GRALLOC :       iova_size=602112,conUsg=0xb00,proUsg=0xb00,     strd=64,[afbc]HdrStrd=0 PyldStrd=0 Scrmbl=0,ionhnd = 1
10-21 11:21:59.531  1240  9323 I chatty  : uid=1000(system) Binder:1240_1C expire 5 lines
10-21 11:21:59.536  1240  3802 I chatty  : uid=1000(system) Binder:1240_11 expire 4 lines
10-21 11:21:59.576  1796  2334 D NetworkController.MobileSignalController(0): mSimSubId:0 onDataActivity: direction=3
10-21 11:21:59.578  1796  1796 D HwCustMobileSignalControllerImpl: value = 4G, networkTypeIcon = 2131232398 typeIcon = 2131232398
10-21 11:21:59.578  1796  1796 D HwCustMobileSignalControllerImpl: updateDataType, mDataNetType: 13, isCAstate: false
10-21 11:21:59.726   661 17262 I audio_hw_primary: usb_ext_get_parameters: check show hires (false)
10-21 11:21:59.726   690 16431 I hash_map_utils: key: 'typec_need_show_hires' value: ''
10-21 11:21:59.726   690 16431 I bt_a2dp_hw: adev_get_parameters: audio a2dp receive kvpairs typec_need_show_hires ,but need not handle
10-21 11:21:59.727  1240  1574 I chatty  : uid=1000(system) Thread-14 expire 1 line`

Basic Information

nexxuno commented 4 years ago

Hello, I'm the original owner of the bug. Did you have time to have a preliminary look into this? Is there any suggestion for a workaround or possible solution? Thanks.

nexxuno commented 4 years ago

@radekdoulik we'd need an advice if you can: is there any other way to strip IL code plus compiling to native (achieving the sort of obfuscation / IP protection that we need) without using hybrid AOT? This would enable us to workaround this problem. Thanks!

TimoD commented 4 years ago

Hello, I have the same problem with one of my customers apps. I described it here: https://forums.xamarin.com/discussion/177766/invalid-il-code-at-runtime-after-hybrid-aot-compilation After opening a support request with microsoft, the microsoft engineer told me to post here. Can you help me with this problem? Thanks, Timo

radekdoulik commented 4 years ago

I am sorry for the delay. I have tested the App1 project with current master today and it doesn't crash. So hopefully it was fixed meanwhile.

I will try it with older version to make sure I can reproduce it and thus that it was indeed fixed.

nexxuno commented 4 years ago

Thanks a lot, we are currently on Commercial Xamarin.Android 10.1 (d16-4)

taublast commented 4 years ago

hi @radekdoulik any thoughts about this boolean issue? (https://github.com/xamarin/Xamarin.Forms/issues/9876)

TimoD commented 4 years ago

This is still an issue with VS 2019 16.5

Microsoft Visual Studio Professional 2019 Version 16.5.0 VisualStudio.16.Release/16.5.0+29911.84

Xamarin 16.5.000.521 (d16-5@b3ea41e)

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

nexxuno commented 4 years ago

Hello @radekdoulik, any news on this matter?

taublast commented 4 years ago

It's been almost half-a-year we can't publish with hybrid aot due to this bug.. A workaround, anyone?..

nexxuno commented 4 years ago

I've had a look at it and to me it looks like hybrid AOT is not stripping at all anymore. The compiler says it's stripping but then in the apk you find the dlls with all the code visibile.

taublast commented 4 years ago

Please kindly read this thread https://forums.xamarin.com/discussion/comment/415044

nexxuno commented 4 years ago

Thanks. It says it has been fixed but then again it proposes a workaround (moreover a workaround that I can't apply to CI pipelines). All the AOT bugs on github aren't receiving much attention. Some have been open for months/years.

taublast commented 4 years ago

Yes, looks like this get be passed through with a workaround, have been told that Hybrid is experimental and not an official feature so no wonder the priority is kinda low.. It's a shame since this experimental feature makes xamarin viable out-of-the-box for commercials products with requirement to security.

taublast commented 4 years ago

I think the fix is still not live, tried today, crashed with stripped hybrid..

jpobst commented 6 months ago

With support for Classic Xamarin.Android ended May 1st, 2024, this issue is likely no longer relevant.

If this still persists in .NET 8+, please open a new issue with updated information based on net8.0-android or greater. Please include a link to this issue for context.