Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

WebView remains blank only on app release

$
0
0

I've made a very simple and basic Android application using Xamarin Forms using Visual Studio 2017.
Currently, the app is only a container of a WebView used to display a mobile web page.
The app is working perfectly on the Android Emulator, and also when I run it from VS on the device in USB debugging mode.

The content page is defined as this:

<ContentPage xmlns=" theUrl "
             xmlns:x=" theUrl "
             xmlns:local="clr-namespace:NatuMobileC"
             x:Class="NatuMobileC.MainPage">

    <WebView Source=" [here my URL to a 10KB simple web page] " HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">



(Please note the Source of the WebView has been obfuscated intentionally as well as all the URLs of the namespace as I can't put url in the post)

The MainActivity.cs of the Android project:

using System;

using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace NatuMobileC.Droid
{
    [Activity(Label = "NatuMobileC", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
        }
    }
}

I have checked the **INTERNET ** permission under "Required Permissions" in the Android Manifest section of the Android project properties.
(When I install the app on the device, in the permissions alert, Internet is not listed, there's only read&write to SD)

If I deploy the APK file, setting the **release ** configuration for the building, therefore "Use Shared Runtime>Use Fast Deployment" is unchecked, the application load, but the WebView remains blank.

Attaching the device to Android Device Monitor, I can see the following log messages looping in LogCat:

03-09 14:35:00.046: D/ContextRelationMgrBrdg(8256): loadKlass() : caller=com.samsung.android.bridge.multiscreen.common.ContextRelationManagerBridge.<clinit>:28 android.app.LoadedApk.makeApplication:840 
03-09 14:35:00.088: W/monodroid(8256): Creating public update directory: `/data/user/0/natumob.natumob/files/.__override__`
03-09 14:35:00.089: W/monodroid(8256): Using override path: /data/user/0/natumob.natumob/files/.__override__
03-09 14:35:00.089: W/monodroid(8256): Trying to load sgen from: /data/user/0/natumob.natumob/files/.__override__/libmonosgen-2.0.so
03-09 14:35:00.089: W/monodroid(8256): Trying to load sgen from: /storage/emulated/0/Android/data/natumob.natumob/files/.__override__/libmonosgen-2.0.so
03-09 14:35:00.089: W/monodroid(8256): Trying to load sgen from: /storage/emulated/0/../legacy/Android/data/natumob.natumob/files/.__override__/libmonosgen-2.0.so
03-09 14:35:00.089: W/monodroid(8256): Trying to load sgen from: /data/app/natumob.natumob-1/lib/arm64/libmonosgen-2.0.so
03-09 14:35:00.089: W/monodroid(8256): Trying to load sgen from: /data/user/0/natumob.natumob/files/.__override__/links/libmonosgen-2.0.so
03-09 14:35:00.104: A/monodroid(8256): No assemblies found in '/data/user/0/natumob.natumob/files/.__override__' or '/storage/emulated/0/Android/data/natumob.natumob/files/.__override__'. Assuming this is part of Fast Deployment. Exiting...

03-09 14:35:00.106: I/TMSDISP(8256): AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - Enter
03-09 14:35:00.106: I/TMSDISP(8256): AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - Enter2
03-09 14:35:00.106: I/TMSDISP(8256): AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - mSource2
03-09 14:35:00.106: I/TMSDISP(8256): AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - Exit

Thanks for the help, and sorry if I missed something, it's my very first code on Xamarin


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>