2017-09-05 37 views
0

我可以運行我的應用程序沒有任何問題在Android 6.0+設備上,但我需要強大的與Android 4.4的retrocompatibility。Xamarin.Android Android 4.4(API 19)在啓動時引發錯誤使用Xamarin.Forms

我將目標android版本和最低版本設置爲KitKat,並將編譯版本保留爲「使用最新版本」。該應用程序構建,但不運行在我的設備或模擬器[19級](我得到的「應用程序已停止」警報比沒有)。該應用程序仍然適用於較新的設備。

我試圖將編譯版本設置爲API Level 19,但是我的應用程序沒有這種編譯方式。我得到這個錯誤:

No resource found that matches the given name: attr 'android:elevation'

於是,我就從降級版本25.xx我Xamarin形式包19.xx但提醒的NuGet我說,這些軟件包並不存在:

... 
    <package id="Xamarin.Android.Support.Annotations" version="19.0.0" targetFramework="monoandroid71" /> 
    <package id="Xamarin.Android.Support.Compat" version="19.0.0" targetFramework="monoandroid71" /> 
... 
+0

在logcat中,我發現:'致命異常:主要 過程:it.xxx.android,PID:12703 了java.lang.RuntimeException:無法實例化應用md58be93af4beb389e425842ea692c954d2.MainApplication:拋出java.lang.ClassNotFoundException:未找到「md58be93af4beb389e425842ea692c954d2.MainApplication」' – Cristiano

回答

0

您應該將Xamarin和Xamarin.Android更新爲最新的穩定頻道。它必須通過卸載應用程序,共享單聲道運行時和我的設備上的Xamarin.Android Api-23 Support進行修復,並進行乾淨的重建。

在您的設備中,轉至設置 - >應用 - >所有應用,然後將其卸載。

0

No resource found that matches the given name: attr 'android:elevation'

android:elevationattribute在5.0推出,所以它只是從API級別21和上工作。

+0

@Cristiano,你解決了你的問題嗎? –

相關問題