Xamarin Forms App Crash on Android

4980
6
05-13-2017 08:12 AM
AndyWright
Occasional Contributor

I just upgraded some of the Android components on my PC, specifically installing the 7.0 and 7.1.1 SDK platforms and the latest Android SDK Tools and platforms tools.  My application still works fine when I debug directly to my Android device from Visual Studio, but when I try to deploy an APK to my device from some other means the app crashes with the following messages.  The interesting stuff is at the end and seems to be related to the Esri API.

 

Is there a workaround to this or do I need to revert back to my Android setup prior to the upgrades I just performed?  Any help is appreciated ...

00:00 W/monodroid: Calling into managed runtime init
00:00 E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
00:00 W/monodroid-debug: Not starting the debugger as the timeout value has been reached; current-time: 1494685025 timeout: 1494684196
00:00 W/monodroid-gc: GREF GC Threshold: 46080
00:00 W/monodroid: Trying to load sgen from: /data/app/com.epochsg.epochfield-1/lib/arm/libmonosgen-2.0.so
00:00 D/ActivityThread: Added TimaKeyStore provider
00:00 D/TimaKeyStoreProvider: TimaSignature is unavailable
00:00 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:00 D/SensorManager: registerListener :: 0, BMI055 Accelerometer Sensor, 200000, 0,
00:00 D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
00:00 D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
00:00 I/OpenGLRenderer: HWUI protection enabled for context , &this =0x97c22088 ,&mEglDisplay = 1 , &mEglConfig = -1748757580
00:00 D/PhoneWindow: *FMB* installDecor flags : -2139029248
00:00 I/OpenGLRenderer: Initialized EGL, version 1.4
00:00 I/: PLATFORM VERSION : JB-MR-2
00:00 D/PhoneWindow: *FMB* installDecor flags : 8388610
00:00 D/PhoneWindow: *FMB* installDecor mIsFloating : false
00:00 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:00 D/PhoneWindow: *FMB* installDecor mIsFloating : true
00:00 D/OpenGLRenderer: Render dirty regions requested: true
00:00 D/Atlas: Validating map...
00:00 W/System.err: remove failed: ENOENT (No such file or directory) : /data/data/com.epochsg.epochfield/shared_prefs/com.testfairy.sdk.activities.WelcomeActivity.xml.bak
00:00 D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
00:00 D/OpenGLRenderer: endAllStagingAnimators on 0x97eac500 (RippleDrawable) with handle 0x97c074e0
00:00 D/OpenGLRenderer: Enabling debug mode 0
00:00 D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
00:00 D/OpenGLRenderer: Get maximum texture size. GL_MAX_TEXTURE_SIZE is 8192
00:00 I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@1806b9b4 time:2737476
00:00 D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
00:00 I/Timeline: Timeline: Activity_launch_request id:com.epochsg.epochfield time:2739600
00:00 E/ViewRootImpl: sendUserActionEvent() mView == null
00:00 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:00 I/System.out: Thread-2125(ApacheHTTPLog):Reading from variable values from setDefaultValuesToVariables
00:00 I/System.out: Thread-2125(ApacheHTTPLog):isSBSettingEnabled false
00:00 I/System.out: Thread-2125(ApacheHTTPLog):SMARTBONDING_ENABLED is false
00:00 I/System.out: Thread-2125(ApacheHTTPLog):isShipBuild true
00:00 I/System.out: Thread-2125(ApacheHTTPLog):SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
00:00 I/Timeline: Timeline: Activity_launch_request id:com.epochsg.epochfield time:2739998
00:00 D/PhoneWindow: *FMB* installDecor mIsFloating : false
00:00 D/PhoneWindow: *FMB* installDecor flags : 8454402
00:00 D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
00:00 D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
00:00 E/ViewSystem: ViewRootImpl #2 Surface is not valid.
00:00 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:00 D/PhoneWindow: *FMB* installDecor flags : -2139029248
00:00 D/PhoneWindow: *FMB* installDecor mIsFloating : false
00:00 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md5d520a45cae5c9d1f41fe05fc2c64048d.CompassCalibration
00:01 I/System.out: pool-1-thread-1 calls detatch()
00:01 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md561e589923a13617eb075fd6f9859def2.UserInteractionHandler
00:02 I/art: Explicit concurrent mark sweep GC freed 14998(815KB) AllocSpace objects, 5(102KB) LOS objects, 40% free, 13MB/21MB, paused 317us total 17.907ms
00:02 I/mono-stdout: Binding: 'ItemTappedCommand' property not found on 'EFCloud.ViewModels.CircuitFilterToolViewModel', target property: 'EFCloud.Behaviors.EventToCommandBehavior.Command'
00:03 I/mono-stdout: Binding: 'Image' property not found on 'EFCloud.ViewModels.InspectionsToolViewModel', target property: 'EFCloud.Components.ToolButtonControl.Source'
00:03 I/mono-stdout: Binding: Xamarin.Forms.FileImageSource can not be converted to type 'System.String'
00:03 I/mono-stdout: Binding: 'CompleteInspectionPointEnabled' property not found on 'EFCloud.ViewModels.InspectionsToolViewModel', target property: 'EFCloud.Components.ToolButtonControl.ToolEnabled'
00:03 I/mono-stdout: Binding: 'ObjectId' property not found on 'EFCloud.ViewModels.InspectionsToolViewModel', target property: 'EFCloud.Components.ToolButtonControl.CommandParameter'
00:03 I/mono-stdout: Binding: 'ItemTappedCommand' property not found on 'EFCloud.ViewModels.DownloadToolViewModel', target property: 'EFCloud.Behaviors.EventToCommandBehavior.Command'
00:03 I/mono-stdout: Binding: 'Image' property not found on 'EFCloud.ViewModels.MapPageViewModel', target property: 'EFCloud.Components.ToolButtonControl.Source'
00:03 I/mono-stdout: Binding: Xamarin.Forms.FileImageSource can not be converted to type 'System.String'
00:03 I/mono-stdout: Binding: 'NewItemCount' property not found on 'EFCloud.ViewModels.MapPageViewModel', target property: 'Xamarin.Forms.Label.Text'
00:03 I/mono-stdout: Binding: 'Equals(false)' property not found on 'False', target property: 'Xamarin.Forms.Image.IsVisible'
00:04 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer
00:04 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md5b60ffeb829f638581ab2bb9b1a7f4f3f.ImageRenderer
00:04 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md5b60ffeb829f638581ab2bb9b1a7f4f3f.LabelRenderer
00:04 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md5efbefd3c8b9b9ae4c417cc780f376496.GeoViewRenderer
00:04 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md5b60ffeb829f638581ab2bb9b1a7f4f3f.FrameRenderer
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md5b60ffeb829f638581ab2bb9b1a7f4f3f.ActivityIndicatorRenderer
00:04 I/art: Explicit concurrent mark sweep GC freed 4424(247KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 14MB/23MB, paused 344us total 13.414ms
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for md5b60ffeb829f638581ab2bb9b1a7f4f3f.PickerRenderer
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 D/AbsListView: Get MotionRecognitionManager
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:04 W/ResourceType: Failure getting entry for 0x01080ac2 (t=7 e=2754) (error -75)
00:05 W/System.err: remove failed: ENOENT (No such file or directory) : /data/data/com.epochsg.epochfield/shared_prefs/testfairy.preferences.xml.bak
00:05 I/Choreographer: Skipped 84 frames! The application may be doing too much work on its main thread.
00:05 D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
00:05 D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
00:05 I/mono-stdout: Binding: 'Equals(false)' property not found on 'True', target property: 'Xamarin.Forms.Image.IsVisible'
00:05 I/System.out: Thread-2138(ApacheHTTPLog):SMARTBONDING_ENABLED is false
00:05 I/System.out: Thread-2138(ApacheHTTPLog):SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
00:05 I/System.out: Thread-2138(ApacheHTTPLog):isShipBuild true
00:05 I/System.out: Thread-2138(ApacheHTTPLog):isSBSettingEnabled false
00:06 I/MonoDroid: UNHANDLED EXCEPTION:
00:06 I/System.out: pool-2-thread-1 calls detatch()
00:06 I/MonoDroid: at Android.Views.ViewGroup.n_AddView_Landroid_view_View_I (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_child, System.Int32 index) [0x00011] in <e990e46faeb94543b78f25dee3aed17e>:0
00:06 I/MonoDroid: at Esri.ArcGISRuntime.UI.Controls.MapView.AddView (Android.Views.View child, System.Int32 index) [0x00000] in <687a544c38e8410dbac0acfc0843ba7e>:0
00:06 I/MonoDroid: at Esri.ArcGISRuntime.UI.Controls.GeoView.AddView (Android.Views.View child, System.Int32 index) [0x00014] in <687a544c38e8410dbac0acfc0843ba7e>:0
00:06 I/MonoDroid: System.NotSupportedException: AddView is for internal use only
00:06 I/MonoDroid: at (wrapper dynamic-method) System.Object:ec7a4659-3ab8-4d2d-930d-b041841bb258 (intptr,intptr,intptr,int)
00:06 W/art: JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
00:06 D/AndroidRuntime: Shutting down VM
00:06 I/System.out: Thread-2142(ApacheHTTPLog):isSBSettingEnabled false
00:06 I/System.out: Thread-2142(ApacheHTTPLog):SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
00:06 I/System.out: Thread-2142(ApacheHTTPLog):SMARTBONDING_ENABLED is false
00:06 I/System.out: Thread-2142(ApacheHTTPLog):isShipBuild true
00:06 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.epochsg.epochfield, PID: 19814
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
... 1 more
Caused by: android.runtime.JavaProxyThrowable: System.NotSupportedException: AddView is for internal use only
at Esri.ArcGISRuntime.UI.Controls.GeoView.AddView (Android.Views.View child, System.Int32 index) [0x00014] in <687a544c38e8410dbac0acfc0843ba7e>:0
at Esri.ArcGISRuntime.UI.Controls.MapView.AddView (Android.Views.View child, System.Int32 index) [0x00000] in <687a544c38e8410dbac0acfc0843ba7e>:0
at Android.Views.ViewGroup.n_AddView_Landroid_view_View_I (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_child, System.Int32 index) [0x00011] in <e990e46faeb94543b78f25dee3aed17e>:0
at (wrapper dynamic-method) System.Object:ec7a4659-3ab8-4d2d-930d-b041841bb258 (intptr,intptr,intptr,int)
at Esri.ArcGISRuntime.UI.MapView.n_addView(Native Method)
at Esri.ArcGISRuntime.UI.MapView.addView(MapView.java:110)
at com.testfairy.i.a(SourceFile:83)
at com.testfairy.i.a(SourceFile:333)
at com.testfairy.sdk.aa.run(SourceFile:2902)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6117)
... 4 more
00:06 I/System.out: Thread-2145(ApacheHTTPLog):isShipBuild true
00:06 I/System.out: Thread-2145(ApacheHTTPLog):isSBSettingEnabled false
00:06 I/System.out: Thread-2145(ApacheHTTPLog):SMARTBONDING_ENABLED is false
00:06 I/System.out: Thread-2145(ApacheHTTPLog):SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
00:06 I/System.out: pool-4-thread-1 calls detatch()
00:07 I/System.out: Thread-2148(ApacheHTTPLog):isSBSettingEnabled false
00:07 I/System.out: Thread-2148(ApacheHTTPLog):SMARTBONDING_ENABLED is false
00:07 I/System.out: Thread-2148(ApacheHTTPLog):isShipBuild true
00:07 I/System.out: Thread-2148(ApacheHTTPLog):SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
00:07 I/System.out: pool-5-thread-1 calls detatch()
00:08 I/art: Explicit concurrent mark sweep GC freed 12538(723KB) AllocSpace objects, 1(14KB) LOS objects, 8% free, 82MB/90MB, paused 549us total 19.676ms
00:08 I/System.out: Thread-2156(ApacheHTTPLog):isSBSettingEnabled false
00:08 I/System.out: Thread-2156(ApacheHTTPLog):SMARTBONDING_ENABLED is false
00:08 I/System.out: Thread-2156(ApacheHTTPLog):isShipBuild true
00:08 I/System.out: Thread-2156(ApacheHTTPLog):SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
00:08 I/System.out: pool-6-thread-1 calls detatch()

0 Kudos
6 Replies
RichZwaap
Occasional Contributor III

It looks like MapView.AddView is being called, which is explicitly disallowed.  Is the source code in your app making this call?  Or is it somehow being invoked otherwise?  The call stack suggests that some component named "com.testfairy" might be the culprit.

0 Kudos
AndyWright
Occasional Contributor

Hi Rich,

No my app is not explicitly making that call.  TestFairy is a site we use for deploying our apps to testers prior to doing a release to the app store, so it has nothing do with that either.  Even if I deploy a release build of my app directly to my Android tablet (without TestFairy in the mix) it crashes with the same error.  Oddly enough a debug build works fine.

There was another post on here that referenced the same error, but it doesn't look like it was ever solved.  This is a weird one ...

https://community.esri.com/message/683700-net-runtime-sdk-100-errors-in-android-71?q=AddView 

0 Kudos
RichZwaap
Occasional Contributor III

That other post looks similar on the surface, but the call stack is quite different.  That looks like a rendering issue, whereas this appears to be due to something making a call to MapView.AddView.  Aside from the stack trace making a call there, the resulting exception message, "AddView is for internal use only," is exactly as we'd expect.  It could be that the OS is invoking this for some reason, but that certainly seems odd.  We have exercised 7.0 and 7.1 devices internally, so that suggests this might be something device-specific.  

I just upgraded some of the Android components on my PC, specifically installing the 7.0 and 7.1.1 SDK platforms and the latest Android SDK Tools and platforms tools

So deploying and running your app to this device worked previously?  With the app built in Release?  If so, did you also change the target version of your app?

0 Kudos
AndyWright
Occasional Contributor

It could be.  I'm running a Tab S SM-T800 with Android version 5.0.2 running on it.  It's about 3 years old, so it's no spring chicken but was working great until I upgraded all the Android stuff on my development PC.  The target version for my app has remained the same - Android 5.0 (API Level 21 - Lollipop).  The target framework was Android 6.0 (Marshmallow) before, and I've tried it at Use Latest Platform (Android 7.1 (Nougat)) as well and I get the same error both ways.  The Target Android version has always been Use Compile using SDK version.

You say you've exercised 7.0 and 7.1 devices internally.  Was that on the 100.0 build or something more recent?

0 Kudos
RichZwaap
Occasional Contributor III

With 100.0 as well as more recent.  So whatever it is, it's not a simple matter of across-the-board OS version incompatibility.

Could you try deploying a new app created from our project template to see whether that runs into the same issue?

AndyWright
Occasional Contributor

Rich,

I just deployed a vanilla Runtime template app up to Test Fairy and the same thing happened - crash at app launch.  I then uninstalled the app and deployed the raw APK directly to my Android device circumventing the whole Test Fairy thing and it worked fine.  So this looks like an issue specific to Test Fairy rather than something to do with the Esri API.  Not sure why it's barfing on the MapView at launch time, but at least I know who the culprit is.

Thanks for all your suggestions Rich ...

0 Kudos