Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Class AndroidX.Appcompat.Widget.AlertDialogLayout not found exception

$
0
0

Im having this strange problem

im getting this exception

java.lang.ClassNotFoundException: androidx.appcompat.widget.AlertDialogLayout
java.lang.Class.classForName(Native Method)
java.lang.Class.forName Class.java:454
android.view.LayoutInflater.createView LayoutInflater.java:815
android.view.LayoutInflater.createViewFromTag LayoutInflater.java:1006
android.view.LayoutInflater.createViewFromTag LayoutInflater.java:961
androidx.appcompat.app.AppCompatDelegateImpl.setContentView AppCompatDelegateImpl.java:555
androidx.appcompat.app.AppCompatDialog.setContentView AppCompatDialog.java:95
androidx.appcompat.app.AlertController.installContent AlertController.java:232
androidx.appcompat.app.AlertDialog.onCreate AlertDialog.java:279
android.app.Dialog.dispatchOnCreate Dialog.java:554
mono.android.view.View_OnClickListenerImplementor.onClick View_OnClickListenerImplementor.java:30
android.view.View.performClick View.java:7870
mono.android.view.View_OnClickListenerImplementor.onClick View_OnClickListenerImplementor.java:30
android.view.View.performClick View.java:7870

when i try to show a simple diallog in Xamarin.android. i have in "skip linking assemplies" list this "AndroidX.AppCompat.Widget;AndroidX.AppCompat;"

and also i have add this class

using Android.App;
using AndroidX.AppCompat.Widget;

namespace RateMe
{
    static class LinkerPleaseInclude
    {
        static bool falseflag = false;
        static LinkerPleaseInclude()
        {
            if (falseflag)
            {
                var ignore = new FitWindowsLinearLayout(Application.Context);
                var ignore1 = new FitWindowsFrameLayout(Application.Context);


            }
        }
    }
}

im using this class to define my AlertDialog

using AlertDialog = AndroidX.AppCompat.App.AlertDialog;

but i keep getting this exception, only on release configuration (linking sdk i have choose), what i have to do?

I have add in LinkerPleaseInclude

var ignore2 = new AndroidX.AppCompat.App.AlertDialog(Application.Context);

and then i was getting an exception about AndroidX.AppCompat.Widget.DialogTitle

i added this too and then i was getting an exception about AndroidX.AppCompat.Widget.ButtonBarLayout

i added too and now im not getting any exception but i can't understand why linker does not include my option?

Can i feel confident that my app will work to all of the supported android OS without any exceptions about class not found?

I have also try choosing **ProGuard ** with custom config file to keep class **AndroidX.AppCompat.Widget.* ** and that didn't work either


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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