Xamarin for VisualStudio 编译报错

ijianbo
博客专家认证
2015-09-02 06:58:00
报如下错误,请教高手要如何解决?



1>Packaging application..
1>Build started.
1>C:\Program Files (x86)\MSBuild\12.0\bin\Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;__XAMARIN_ANDROID_v1_0__;__MOBILE__;__ANDROID__;__ANDROID_1__;__ANDROID_2__;__ANDROID_3__;__ANDROID_4__;__ANDROID_5__;__ANDROID_6__;__ANDROID_7__;__ANDROID_8__;__ANDROID_9__;__ANDROID_10__;__ANDROID_11__;__ANDROID_12__;__ANDROID_13__;__ANDROID_14__;__ANDROID_15__;__ANDROID_16__;__ANDROID_17__;__ANDROID_18__ /errorendlocation /preferreduilang:en-US /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.3\Mono.Android.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Web.Services.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\App1.dll /target:library /utf8output MainActivity.cs Resources\Resource.Designer.cs Properties\AssemblyInfo.cs Models\Model1.cs Views\RazorView.cs "C:\Users\test\AppData\Local\Temp\MonoAndroid,Version=v4.3.AssemblyAttributes.cs" obj\Debug\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Debug\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Debug\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
1>App1 -> C:\Users\test\documents\visual studio 2013\Projects\App1\bin\Debug\App1.dll
1> Processing: obj\Debug\res\layout\main.xml
1> Processing: obj\Debug\res\values\strings.xml
1> Processing: obj\Debug\res\values\styles.xml
1>D:\Java\jdk1.6.0_39\\bin\java.exe -Xmx1G -jar F:\test\dev\resource\java\adt-bundle-windows-x86-20130717\AndroidSDK\build-tools\android-4.2.2\\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\v4.3\mono.android.jar"
1>"java.exe" exited with code 1.
1>Build FAILED.
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

如果不是编译部署到模拟器里,直接编译报如下错误:

1>------ Rebuild All started: Project: App1, Configuration: Debug Any CPU ------
1> Processing: obj\Debug\res\layout\main.xml
1> Processing: obj\Debug\res\values\strings.xml
1> Processing: obj\Debug\res\values\styles.xml
1> App1 -> C:\Users\test\documents\visual studio 2013\Projects\App1\bin\Debug\App1.dll
1> Processing: obj\Debug\res\layout\main.xml
1> Processing: obj\Debug\res\values\strings.xml
1> Processing: obj\Debug\res\values\styles.xml
1> Processing: obj\Debug\res\layout\main.xml
1> Processing: obj\Debug\res\values\strings.xml
1> Processing: obj\Debug\res\values\styles.xml
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1661,3): error MSB6006: "java.exe" exited with code 1.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


Xamarin.Android.Common.targets(1661,3) 的内容是:

<!-- Compile java code to dalvik -->
<CompileToDalvik
DxJarPath="$(DxJarPath)"
JavaToolPath="$(JavaToolPath)"
JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
JavaOptions="$(JavaOptions)"
ClassesOutputDirectory="$(IntermediateOutputPath)android\bin\classes"
ToolPath="$(DxToolPath)"
ToolExe="$(DxToolExe)"
UseDx="$(UseDx)"
MultiDexEnabled="$(AndroidEnableMultiDex)"
JavaLibrariesToCompile="@(_JavaLibrariesToCompile)"
OptionalObfuscatedJarFile="$(IntermediateOutputPath)proguard\__proguard_output__.jar"
/>


...全文
750 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
ijianbo 2015-09-06
自己顶一下,希望高手指教
  • 打赏
  • 举报
回复
发帖
Xamarin技术

429

社区成员

欢迎来到Xamarin技术交流论坛学习交流,Xamarin是一个行动App开发平台,开发人员透过Xamarin可开发出iOS、Android 与Windows 等平台的...
社区管理员
  • Xamarin技术社区
加入社区
帖子事件
创建了帖子
2015-09-02 06:58
社区公告
暂无公告