App Screen is blank when deployed through AppCenter - android

I have a Xamarin.Forms app built for iOS and Android. The application works fine when tested from Visual Studio (in Debug or Release modes and on the emulator or a device). However, when I try to deploy it through AppCenter, the app works on iOS and on Android, it displays the SplashScreen and then a blank white page. None of my controls show up at all...on iOS it is working fine, so the Views seem to be correct..
I hooked up the Android Device Monitor, but I do not seem to get any error messages. I have tried several changes of the project properties (turning ProGuard and MultiDex on and off; changing the Linker settings), but nothing seems to change the behavior.
I am out of ideas to even look for the problem...does anyone have any suggestions? Has anyone seen this before? Is there anywhere that lists the differences in build between Visual Studio and AppCenter?
UPDATE: I have gotten some additional logging from the Device Monitor. There are additional log entries in the version that works, so it seems that something is not running in the deployed version (maybe associated with Google Maps?).
The version not working has these two lines:
01-09 07:23:04.378: I/Google Maps Android API(11219): Google Play services client version: 11400000
01-09 07:23:04.709: I/LaunchCheckinHandler(1410): Displayed {my application name}/md582f1e314fc580d8ae4e7bb0d59c62d55.MainActivity,wp,ca,537
The version that works has these extra log entries:
01-09 07:28:29.970: I/Google Maps Android API(12443): Google Play services client version: 11400000
01-09 07:28:31.807: I/SFPerfTracer(735): triggers: (rate: 0:0) (9563 sw vsyncs) (0 skipped) (121:40138 vsyncs) (123:54057)
01-09 07:28:32.279: I/SFPerfTracer(735): triggers: (rate: 6:1097) (compose: 0:0) (post: 0:3) (render: 0:4) (125:27407 frames) (126:32007)
01-09 07:28:32.279: D/SFPerfTracer(735): layers: (2:8) (StatusBar#0 (0xaf154000): 4:4927)* (com.android.systemui.ImageWallpaper#0 (0xaf113000): 0:228)* (DimLayerController/Stack=0#0 (0xaf10c000): 0:373)* (animation background stackId=1#0 (0xaf192000): 0:20)* (NavigationBar#0 (0xaf445000): 0:493) (com.android.launcher3/com.android.launcher3.CustomizationPanelLauncher#0 (0xaf424000): 0:14)* (com.android.launcher3/com.android.launcher3.CustomizationPanelLauncher#1 (0xaf2fa000): 0:154)* ({my application name}/md582f1e314fc580d8ae4e7bb0d59c62d55.SplashActivity#0 (0xaf437000): 0:3)
01-09 07:28:32.514: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md58432a647068b097f9637064b8985a5e0.ViewRenderer_2
01-09 07:28:32.652: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.ActivityIndicatorRenderer
01-09 07:28:32.764: I/ThermalEngine(967): Thermal-Server: Thermal received msg from override
01-09 07:28:32.764: I/Thermal-Lib(721): Thermal-Lib-Client: Client request sent
01-09 07:28:32.947: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.TableViewRenderer
01-09 07:28:33.055: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.BaseCellView
01-09 07:28:33.055: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.TextCellRenderer_TextCellView
01-09 07:28:33.083: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.CellRenderer_RendererHolder
01-09 07:28:33.172: W/View(12443): requestLayout() improperly called by md51558244f76c53b6aeda52c8a337f2c37.ScrollViewContainer{3f9ae0f V.E...... ......ID 0,0-1080,1444} during layout: running second layout pass**
01-09 07:28:33.325: I/LaunchCheckinHandler(1410): Displayed {my application name}/md582f1e314fc580d8ae4e7bb0d59c62d55.MainActivity,wp,ca,3558
Can anyone translate these log messages into English so I have some idea where to look for the issue? IS there something extra that needs to be done with Google Maps when it is deployed versus debug/testing?
Thanks in advance.

It may not relate to the OP's issue but I had the same symptom today:
App working fine on Android when deployed from VS.
Blank screen when deployed from the MDM provider (in my case this was Airwatch Workspace ONE).
No useful information provided in the logs and no errors occurred.
I fixed it by unchecking Android Options -> Use shared runtime

Related

Android Bundle package crash on startup

My Delphi project have both android 32 and 64 destination. I can deploy them on my test devices and they both works fine.
Now google forces me to upload a single app bundle file (.aab), so i flagged the "Generate Android App Bundle file (arm + arm64)" option, set up my provisioning keystore, loaded the alias and then generated that .aab file
I uploaded that as a beta release for my app from the android developer portal and after a few hours it became available to download for my test devices. But.. it shows the start up logo.. and nothing else.
I don't really know how to debug this since both the apks are working fine (32 and 64 bit), so i tried to launch adb logcat *:W, but i still cannot get useful info. I got those lines in endless loop:
10-30 09:59:21.656 13723 13723 E systems.<my app name>: Not starting debugger since process cannot load the jdwp agent.
10-30 09:59:21.688 13723 13723 W systems.<my app name>: JIT profile information will not be recorded: profile file does not exits.
10-30 09:59:21.688 13723 13723 W systems.<my app name>: JIT profile information will not be recorded: profile file does not exits.
10-30 09:59:21.703 922 1100 E ANDR-IOP: IIop:: Iop HAL Service is not available.
10-30 09:59:21.707 13723 13743 E Perf : Fail to get file list oat
10-30 09:59:21.707 13723 13743 E Perf : getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
10-30 09:59:21.743 13723 13723 W linker : Warning: "/data/app/<my app name>-43xRWdYLtXcvUAbEkuUk6g==/split_config.arm64_v8a.apk!/lib/arm64-v8a/lib<my app name>.so" unused DT entry: DT_RPATH (type 0xf arg 0x2cf24) (ignoring)
Just for info: getFolderSize() is not a function i use in my code (its not even declared).
Also, i think this is pretty important: my app deploys some .so files (different files for 32 and 64 bit) and some other files, like images and fonts.
Why i think this is important? Just a suspect born reading this similar issue (but with xamarin): https://github.com/xamarin/Xamarin.Forms/issues/11450
I also tried to deploy the .aab manually on my devices but the only thing i found is how to generate the .apks file from the .aab, and i still cannot deploy it on my devices.
I'm using Delphi 10.4.1 and i also tried to recreate the .dproj file setting up everything again.
How i can debug this? Or how i can get more info about the cause?
Edit: Solved it! I had a few problems that, mixed together, caused this; i'll try to list them in case someone will have a similar issue and will end here!
my androidmanifest.template.xml file was generated by an older version of delphi and was missing some important parts
you need to include all the needed .so files in both 32 and 64bit build to actually have them in the bundle
using TPath.GetLibraryPath() when loading .so files can produce different results if you are using it inside a .aab bundle package
i was trying to load one of those .so file from the initialization section using the function TPath.GetLibraryPath() to get the root path, that was causing a unhandled exception that make my app crash into the splash screen
I solved simply removing TPath.GetLibraryPath() from the path i was using to load my .so and now it works

Android : crash because java class not found

My goal is to be able to make my Android TV Mi Box S (Oreo 8.1) transcode properly Dolby Digital+ (EAC3) sounds to Dolby Digital (AC3) and output it to, my AVR through SPDIF.
This transcodindg is possible with Kodi 18.1 applicition but is not proposed by other application or Android 8.1 settings. As Kodi is able to do it I reverse engineered Android stack. My conclusion are : - Android Oreo embeds any necessary codecs ans other stuff to do this transcoding but does not propose the settings to configure this - Android Pie proposes the wanted surround sound setting (output Dolby Digital on SPDIF)
So my goal is to backport Android TvSettings application from Pie to Oreo
I first tryed to generate TvSettings with Android Studio. I hacked the application resources but stopped when I understood that I would have to generate platfom dependacies (for instance SettingsLib.jar)
My second trial is to generate the entire Android platform. The build is complete and I can deploy TvSettings application on a x86 TV simulation BUT when I launched the TvSettings appplication I get this error :
--------- beginning of crash
2019-04-01 12:21:04.976 3987-3987/com.android.tv.settings
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.tv.settings, PID: 3987
java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider:
java.lang.ClassNotFoundException: Didn't find class
"android.support.v4.content.FileProvider" on path: DexPathList[[zip
file
"/data/app/com.android.tv.settings-2DkaCncwGQ874WP-kx3G4Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.android.tv.settings-2DkaCncwGQ874WP-kx3G4Q==/lib/x86,
/system/lib, /vendor/lib]]
I searched this error on internet and it seems that it deals with multidex feature. This multidex feature is well documented for clean developped Android appliacation but nor reaally for applications extracted from Android platform and deployed with adb.
This problem is related to java libraries loading.
I found threads referring Android multidex feature but only for applications buils with Android Studio/Gradle and my app was build with Android platform
What can I do?
have you included fileProvider in your manifest?
Well there seems to be a root error during deployment of my TvSettings application. Here is its log :
E/dex2oat: Invalid version number in dex file header. File: base.apk
I read several pages and found this one very interesting : https://source.android.com/devices/tech/dalvik/configure
So, due to different optimizations, platform apps are not generated with the same file format that apps generated above platform API
My idea is to generate the whole platform including TvSettings app and to deploy TvSettings with adb. So the apk format may be wrong.
My next step is to add in TvSettings/Settings/Android.mk the flag below :
LOCAL_DEX_PREOPT := false

Xamarin.Forms Android app is failing build with System.Security.Cryptography.Cng error

I have suddenly hit a wall with testing my Xamarin.Forms app. IT has suddenly started throwing the two messages below and failing (on my Android Emulator) immediately after the splash screen disappears.
I get the following warning during the build:
Ignoring C:\Users\geral\.nuget\packages\system.security.cryptography.cng\4.3.0\ref\netstandard1.6\System.Security.Cryptography.Cng.dll as it is a Reference Assembly
And then the Output windows shows these message when the app fails:
11-18 09:33:29.257 D/Mono (31723): Assembly Ref addref Xamarin.GooglePlayServices.Tasks[0xe1503180] -> Mono.Android[0xe15031e0]: 26
11-18 09:33:29.260 D/Mono (31723): Assembly Loader probing location: 'System.Security.Cryptography.Cng'.
11-18 09:33:29.260 F/monodroid-assembly(31723): Could not load assembly 'System.Security.Cryptography.Cng' during startup registration.
11-18 09:33:29.260 F/monodroid-assembly(31723): This might be due to an invalid debug installation.
11-18 09:33:29.260 F/monodroid-assembly(31723): A common cause is to 'adb install' the app directly instead of doing from the IDE.
In searching the web, I found a few articles that seemed related but nothing fixes the error. I have updated all NuGet packages and the Android SDK to the latest available. I am out of ideas.
https://forums.xamarin.com/discussion/63584/android-could-not-load-assembly-xxx-during-startup-registration
https://forums.xamarin.com/discussion/42405/debug-deployment-to-device-works-fine-release-fails-with-odd-messages-anybody-have-a-fix-for-this
Anyone have additional suggestions?
The actual answer was a little obvious after I had some time to come back to it. I added the NuGet package directly to my projects and now things are working correctly again. I had assumed the Reference would be sufficient, but in this case a direct reference was apparently needed. Still not sure why, or what changed that made it suddenly become a problem.
But if you get these message in the future try adding the package directly.

Android studio instant-run not work well

I use the Android studio 2.0, and configure the project with the official doc , the config of instant run in the setting window of AS has changed from disabled to enabled state. As well the run icon has lightning now,but when i change the code, just add a toast in a function, and click the lightning run, the application will be exit, and log show like below:
11-24 19:59:40.382 20951-20957/com.ss.android.essay.joke I/art: System.exit called, status: 1
11-24 19:59:40.383 20951-20957/com.xxx I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
11-24 19:59:40.475 4922-14521/? I/WindowState: WIN DEATH: Window{651bd86 u0 com.ss.android.essay.joke/com.xxx.MainActivity}
Edit:The status of bug has updated,crash not happened again with alpha2,but still can't use instant-run, more detail:https://code.google.com/p/android/issues/detail?id=195064
Edit: Android studio 2.1.1 with 2.12 gradle work well now.
Pretty sure your change is not covered by Instant Run, check out Android tools site for a list of supported hot swap actions:

Android Google Maps gives a ClassNotFoundException

I am creating an app tht uses Google Maps API v2. It works fine, except for a little annoying this, when I use the setMyLocationEnabled(true); method, I get a ClassNotFoundException. I can just click "Resume" and the app continues. When running without debugger, there is nothing you can see happening.
This is what LogCat is saying:
09-23 22:39:31.645: I/dalvikvm(2067): Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lglm;'
09-23 22:39:31.645: W/dalvikvm(2067): Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
09-23 22:39:32.473: W/dalvikvm(2067): VFY: unable to resolve static field 4203 (CREATOR) in Lcom/google/android/gms/location/internal/ParcelableGeofence;
It looks like a missing class in the library, and if I jump into the library project, I indeed do not see that class.
Is there anything I can add / fix to make this exception go away?
I have seen that logcat error before and I noticed it is due to mismatch in my API key between debug and release mode. If you are using separate key store for debug, please make sure you have included both debug and release SHA1+package.name combos in the Google Dev Console.

Categories

Resources