【发布时间】:2018-02-22 07:10:00
【问题描述】:
我有一个 xamarin.form PCL。
在 DEBUG 中找到应用构建并运行。 我想启用“ProGuard”功能。
但出现以下错误:
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2053,3): error MSB6006: "java.exe" exited with code 1.
我做了什么:
- 设置最大堆大小:1G 到 5G。
- 启用/禁用 Multi-Dex
- 在:仅 SDK 程序集/SDK 和用户程序集之间切换
- 已更新至最新的 ProGuard,并保留旧 ProGuard 的最新配置。
- 更新了 SDK 管理器。
- jdk1.8.0_111
- 设置 Xamarin 诊断输出强度:诊断。
找不到任何其他错误。
Android 项目包含 -proguard.cfg
# General Android
-dontwarn org.apache.http.**
-dontwarn android.net.http.AndroidHttpClient
我检查了 Xamarin.android.Common.targets 中的第 2053 行:
<Proguard
Condition="'$(AndroidEnableProguard)' == 'True' and '$(_ProguardProjectConfiguration)' != ''"
ProguardJarPath="$(ProguardJarPath)"
AndroidSdkDirectory="$(_AndroidSdkDirectory)"
JavaToolPath="$(JavaToolPath)"
ProguardToolPath="$(ProguardToolPath)"
ToolExe="$(ProguardToolExe)"
UseProguard="$(UseProguard)"
JavaPlatformJarPath="$(JavaPlatformJarPath)"
ClassesOutputDirectory="$(IntermediateOutputPath)android\bin\classes"
AcwMapFile="$(_AcwMapFile)"
ProguardCommonXamarinConfiguration="$(IntermediateOutputPath)proguard\proguard_xamarin.cfg"
ProguardGeneratedReferenceConfiguration="$(_ProguardProjectConfiguration)"
ProguardGeneratedApplicationConfiguration="$(IntermediateOutputPath)proguard\proguard_project_primary.cfg"
ProguardConfigurationFiles="$(ProguardConfigFiles)"
JavaLibrariesToEmbed="@(_JavaLibrariesToCompile);@(_InstantRunJavaReference)"
ExternalJavaLibraries="@(AndroidExternalJavaLibrary)"
DoNotPackageJavaLibraries="@(_ResolvedDoNotPackageAttributes)"
ProguardJarOutput="$(IntermediateOutputPath)proguard\__proguard_output__.jar"
EnableLogging="$(ProguardEnableLogging)"
DumpOutput="$(IntermediateOutputPath)proguard\dump.txt"
PrintSeedsOutput="$(IntermediateOutputPath)proguard\seeds.txt"
PrintUsageOutput="$(IntermediateOutputPath)proguard\usage.txt"
PrintMappingOutput="$(IntermediateOutputPath)proguard\mapping.txt"
/>
使用最新版本编译 最小:23 目标:使用编译SDK版本
VS2015 NDK 和 SDK 参考是正确的,因为我可以在 DEBUG 中生成构建。
详细:诊断
3>C:\TEST_TFS\XXXX.XXXXX-XXXX-XXXX\XXXXX-XXXX-XXXX-branch-no-auth\APP.XXXXX.XXXX\APP.XXXXX.XXXX.Droid\AWClient-SDK.dll : warning XA0101: @(Content) build action is not supported
3>C:\TEST_TFS\XXXX.XXXXX-XXXX-XXXX\XXXXX-XXXX-XXXX-branch-no-auth\APP.XXXXX.XXXX\APP.XXXXX.XXXX.Droid\LocalDb\DatabaseConnection_Android.cs(22,30,22,32): warning CS0168: The variable 'ex' is declared but never used
3>C:\TEST_TFS\XXXX.XXXXX-XXXX-XXXX\XXXXX-XXXX-XXXX-branch-no-auth\APP.XXXXX.XXXX\APP.XXXXX.XXXX.Droid\PCL\PlatformStyleBO.cs(19,24,19,44): warning CS0169: The field 'PlatformStyleBO._buttonHeightRequest' is never used
3> APP.XXXXX.XXXX.Droid -> C:\TEST_TFS\XXXX.XXXXX-XXXX-XXXX\XXXXX-XXXX-XXXX-branch-no-auth\APP.XXXXX.XXXX\APP.XXXXX.XXXX.Droid\bin\Release\APP.XXXXX.XXXX.Droid.dll
3>C:\TEST_TFS\SSSSS.XXXXX-XXXX-XXXX\XXXXX-XXXX-XXXX-branch-no-auth\APP.XXXXX.XXXX\APP.XXXXX.XXXX.Droid\APP.XXXXX.XXXX.Droid.csproj : warning XA0105: The $(TargetFrameworkVersion) for FormsViewGroup.dll (vv8.0) is greater than the $(TargetFrameworkVersion) for your project (v7.1). You need to increase the $(TargetFrameworkVersion) for your project.
3>C:\TEST_TFS\SSSSS.XXXXX-XXXX-XXXX\XXXXX-XXXX-XXXX-branch-no-auth\APP.XXXXX.XXXX\APP.XXXXX.XXXX.Droid\APP.XXXXX.XXXX.Droid.csproj : warning XA0105: The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (vv8.0) is greater than the $(TargetFrameworkVersion) for your project (v7.1). You need to increase the $(TargetFrameworkVersion) for your project.
3>C:\TEST_TFS\SSSSS.XXXXX-XXXX-XXXX\XXXXX-XXXX-XXXX-branch-no-auth\APP.XXXXX.XXXX\APP.XXXXX.XXXX.Droid\APP.XXXXX.XXXX.Droid.csproj : warning XA0105: The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.dll (vv8.0) is greater than the $(TargetFrameworkVersion) for your project (v7.1). You need to increase the $(TargetFrameworkVersion) for your project.
3>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2053,3): error MSB6006: "java.exe" exited with code 1.
【问题讨论】:
标签: c# android xamarin proguard