Closed AnthonyLatty closed 5 years ago
I have the same problem with Xamarin.Forms on release version.
FATAL EXCEPTION: main Process: com.xxxxxxxx.movil, PID: 4377 android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class android.support.v7.widget.AlertDialogLayout
Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class android.support.v7.widget.AlertDialogLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.AlertDialogLayout" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.phuyusalud.movil-MNIzraJSi4xxl05wRbOE5g==/base.apk"],nativeLibraryDirectories=[/data/app/com.phuyusalud.movil-MNIzraJSi4xxl05wRbOE5g==/lib/arm64, /system/fake-libs64, /data/app/com.phuyusalud.movil-MNIzraJSi4xxl05wRbOE5g==/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]
Are you using proguard/r8 and/or multidex?
You may need to add some rules to proguard/r8 to keep these classes if so
-keep android.support.v7.widget.AlertDialogLayout
Where would you specify these rules for r8??
Anyone encountering this issue, the line that worked for me was -keep public class android.support.v7.widget.*
@StevenGranados I'm running into the same issue, where do you specify that rule?
Create a file with the line in it and set the build action of the file to proguard configuration.
Thanks Steven! So, I'm guessing R8 also reads this config file?
It works for me with r8 so I guess it does.
Getting error after adding proguard.cfg
Getting error after adding proguard.cfg
Solved Make sure proguard.cfg file encoding is UTF-8
And if it's not obvious(like it wasn't to me when I added the file), also make sure you set the BuildAction to ProguardConfiguration.
xamarin/Xamarin.Forms#9318 Might help with this issue in Forms 4.5.0
Xamarin.Android Version (eg: 6.0):
9.0
Operating System & Version (eg: Mac OSX 10.11):
Mac OS 10.14.6
Support Libraries Version (eg: 23.3.0):
Upgraded from 28.0.0.1 to 28.0.0.3
Describe your Issue:
When using latest Xamarin.Android with support libraries 28.0.0.3 there is crash in "AlertDialogLayout" (strack trace below).
java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.AlertDialogLayout" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar"
Steps to Reproduce (with link to sample solution if possible):
Update Visual Studio to latest stable. Add project targeting API Level 28. Add latest support libraries 28.0.0.3. Create a Dialog Run App.
Include any relevant Exception Stack traces, build logs, adb logs: