编译xamarin-android应用程序时出现java.exe错误

时间:2018-04-29 18:24:53

标签: java xamarin xamarin.android

我正在开发一个应用程序,突然间我开始出现构建错误,

我也试过增加java的堆大小,但没有任何工作,任何人都可以帮我放?

这是日志....

>      > `C:\Program Files\Java\jdk1.8.0_131\\bin\java.exe -jar C:\Users\DELL\AppData\Local\Xamarin\MonoForAndroid\AndroidSDK\build-tools\25.0.1\\lib\dx.jar
> --no-strict --dex --output=obj\Debug\android\bin obj\Debug\android\bin\classes "C:\Program Files (x86)\Reference
> Assemblies\Microsoft\Framework\MonoAndroid\v7.0\mono.android.jar"
> obj\Debug\__library_projects__\Telerik.Xamarin.Android.Common\library_project_imports\bin\Common.jar
> obj\Debug\__library_projects__\Telerik.Xamarin.Android.Data\library_project_imports\bin\Data.jar
> obj\Debug\__library_projects__\Telerik.Xamarin.Android.Gauges\library_project_imports\bin\Gauges.jar
> obj\Debug\__library_projects__\Telerik.Xamarin.Android.Input\library_project_imports\bin\Input.jar obj\Debug\__library_projects__\Telerik.Xamarin.Android.List\library_project_imports\bin\List.jar
> obj\Debug\__library_projects__\Telerik.Xamarin.Android.Primitives\library_project_imports\bin\Primitives.jar
> obj\Debug\__library_projects__\TwilioClient.Android\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\TwilioClient.Android\library_project_imports\libs\org.apache.http.legacy.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Animated.Vector.Drawable\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Compat\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Core.UI\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Core.Utils\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Design\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Fragment\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Media.Compat\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Transition\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.v4\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.v7.AppCompat\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.v7.RecyclerView\library_project_imports\bin\classes.jar
> obj\Debug\__library_projects__\Xamarin.Android.Support.Vector.Drawable\library_project_imports\bin\classes.jar
> C:\Users\DELL\AppData\Local\Xamarin\Xamarin.Android.Support.CustomTabs\23.3.0.0\embedded\classes.jar
> 
>         1>  
>         1>  trouble writing output: Too many field references: 65539; max is 65536.
>         1>  You may try using --multi-dex option.
>         1>  References by package:
>         1>       2 android.accounts
>         1>      27 android.app
>         1>      24 android.content.pm
>         1>      10 android.content.res
>         1>      45 android.graphics
>         1>       2 mono.android.speech
>         1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2068,3):
> error MSB6006: "java.exe" exited with code 2.
>         1>    DexOutputs: 
>         1>      obj\Debug\android\bin\classes.dex
>         1>Done executing task "CompileToDalvik" -- FAILED.
>         1>Done building target "_CompileToDalvikWithDx" in project "TestVoipApp.csproj" -- FAILED.
>         1>
>         1>Build FAILED.`

任何建议?

1 个答案:

答案 0 :(得分:3)

开启 MultiDex

Xamarin.Android - >转到属性 - > AndroidOptions - >启用MultiDex