我之前在我的xamarin android项目中遇到java.exe退出错误但是在启用multi dex后我得到了这种奇怪的错误。任何人都可以帮我找到解决方案吗?
这是错误
MultiDexMainDexListFile: obj\Debug\multidex.keep
1> CustomMainDexListFiles:
1> ToolExe: mainDexClasses.bat
1> ToolPath: C:\Users\Muhammad Tayyab\AppData\Local\Android\android-sdk\build-tools\23.0.3\\
1> ProguardHome: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\proguard\
1> Environment Variables passed to tool:
1> PROGUARD_HOME=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\proguard\
1> JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
1> C:\Users\Muhammad Tayyab\AppData\Local\Android\android-sdk\build-tools\23.0.3\\mainDexClasses.bat --output obj\Debug\multidex.keep "'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v7.0\mono.android.jar';'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\android-support-multidex.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';'obj\Debug\__library_projects__\Xamarin.Firebase.Common\library_project_imports\classes.jar';'obj\Debug\__library_projects__\Xamarin.Firebase.Iid\library_project_imports\classes.jar';'obj\Debug\__library_projects__\Xamarin.Firebase.Messaging\library_project_imports\classes.jar';'obj\Debug\__library_projects__\Xamarin.GooglePlayServices.Base\library_project_imports\classes.jar';'obj\Debug\__library_projects__\Xamarin.GooglePlayServices.Basement\library_project_imports\classes.jar';'obj\Debug\__library_projects__\Xamarin.GooglePlayServices.Tasks\library_project_imports\classes.jar';'C:\Users\Muhammad Tayyab\AppData\Local\Xamarin\Xamarin.Android.Support.CustomTabs\23.3.0.0\embedded\classes.jar';'obj\Debug\android\bin\classes'"
1>CREATEMULTIDEXMAINDEXCLASSLIST : error : Unknown option '[2598:39D0][2016-11-22T22:11:15]i001:' in line 1 of file 'C:\Users\Muhammad',
1> included from argument number 13
1> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
1> Invalid option
1> Usage:
1>
1> Short version: Don't use this.
1>
1> Slightly longer version: This tool is used by mainDexClasses script to build
1> the main dex list.
1> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
1> The command exited with code -1.
1>Done executing task "CreateMultiDexMainDexClassList" -- FAILED.
1>Done building target "_CompileToDalvikWithDx" in project "VoipApp.csproj" -- FAILED.
1>
1>Build FAILED.
答案 0 :(得分:0)
当您的Android SDK路径在其路径之间有空格时,通常会发生此错误,这是Xamarin multidex中的已知错误,您可以找到相关信息here。
现在解决问题非常简单,您当前的SDK路径就是这样的
:C:\Users\Muhammad Tayyab\AppData\Local\Android\android-sdk
将它移到这样的地方可以很好地解决你的问题:
C:\Users\Android\android-sdk\
古德勒克! 如果不起作用则还原