1

将我的 vs2017 更新到 16.6.5,并将 google sdk-build-tools 更新到 27.0.3 后,我的项目在调试我的平板电脑时遇到了问题。我的项目类型是 xamarin.android,我检查了它是否有 xamarin.forms,但我的(不是模拟器)平板电脑的调试是炒锅!同样在此更新之前,我的调试没有任何问题。这是我在诊断模式下的项目输出:

3>Done executing task "Delete".
3>Using "AndroidZipAlign" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll".
3>Task "AndroidZipAlign"
3>Task Parameter:Source=F:\Projects\Amin\AminApp\AminApp\obj\Debug\android\bin\com.aminsystem.forush.apk
3>Task Parameter:DestinationDirectory=bin\Debug\
3>Task Parameter:ToolPath=C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3
3>AndroidZipAlign Task
3>  Alignment: 4
3>  Source: F:\Projects\Amin\AminApp\AminApp\obj\Debug\android\bin\com.aminsystem.forush.apk
3>  DestinationDirectory: bin\Debug\
3>C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\zipalign.exe 4 "F:\Projects\Amin\AminApp\AminApp\obj\Debug\android\bin\com.aminsystem.forush.apk" "bin\Debug\\com.aminsystem.forush-Signed.apk" 
3>Done executing task "AndroidZipAlign".
3>Task "AndroidZipAlign"
3>Task Parameter:Source=F:\Projects\Amin\AminApp\AminApp\obj\Debug\android\bin\com.aminsystem.forush-armeabi-v7a.apk
3>Task Parameter:DestinationDirectory=bin\Debug\
3>Task Parameter:ToolPath=C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3
3>AndroidZipAlign Task
3>  Alignment: 4
3>  Source: F:\Projects\Amin\AminApp\AminApp\obj\Debug\android\bin\com.aminsystem.forush-armeabi-v7a.apk
3>  DestinationDirectory: bin\Debug\
3>C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\zipalign.exe 4 "F:\Projects\Amin\AminApp\AminApp\obj\Debug\android\bin\com.aminsystem.forush-armeabi-v7a.apk" "bin\Debug\\com.aminsystem.forush-armeabi-v7a-Signed.apk" 
3>Output file 'bin\Debug\\com.aminsystem.forush-armeabi-v7a-Signed.apk' exists
3>"zipalign.exe" exited with code 1.
3>Done executing task "AndroidZipAlign" -- FAILED.
3>Done building target "_Sign" in project "AminApp.csproj" -- FAILED.
3>Done building project "AminApp.csproj" -- FAILED.
3>Build FAILED.
3>
3>Deploy failed on Samsung SM-T585
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

如您所见,我的项目编译成功!

我还尝试将 zipalign.exe 从 Android\android-sdk\build-tools\27.0.3 复制到 Android\android-sdk\tools,但它不起作用。

4

2 回答 2

0

就我而言,zipalign.exe它被 Windows 病毒和威胁保护阻止了,一旦我允许它,它就开始正常工作。

于 2019-06-11T06:10:37.497 回答
0

通过将 Debug 选项更改为 X86 解决了该问题!感谢https://www.c-sharpcorner.com/forums/deployment-error-with-xamarin-android-application

于 2018-04-09T06:49:10.700 回答