2017-06-01 53 views
0

我有很簡單的xamarin經典的應用有以下.axml文件沒有找到路徑類「android.support.constraint.ConstraintLayout」:DexPathList在Xamarin.Android

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Hello World!"/> 
</android.support.constraint.ConstraintLayout> 

及以下.cs文件

[Activity(Label = "sa", MainLauncher = true, Icon = "@mipmap/icon")] 
public class MainActivity : Activity 
{ 
    protected override void OnCreate(Bundle savedInstanceState) 
    { 
     base.OnCreate(savedInstanceState); 
     SetContentView(Resource.Layout.Main);//error throws here 
    } 
} 

我發現.gradle下面的代碼,以使約束佈局

dependencies { 
       compile 'com.android.support.constraint:constraint-layout:1.0.2' 
      } 

但是,當然,它ð在Xamarin.Android沒有工作。我試圖安裝 Xamarin Android Constraint Layout 1.0.0-beta5

但它不適用於Mono.Android 6.0。

我該如何解決我的問題?任何猜測?

回答

0

我需要的是改變單聲道框架版本是android.csproj v7.0

1

android.support.constraint.ConstraintLayout由於某種原因沒有生成dex列表。

部分原因可能是:

  • 它沒有安裝
  • 它被鏈接遠
  • 它不使主DEX列表,而是隻二級DEX列表。

使用優雅的鯊魚來確定發生了什麼(https://github.com/google/android-classyshark)。確保鏈接器設置設置爲None,以確保Mono鏈接器不會將其移除。

相關問題