将我的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,但它不起作用。
通过将Debug选项更改为X86解决了该问题!感谢https://www.c-sharpcorner.com/forums/deployment-error-with-xamarin-android-application
在我的情况下,zipalign.exe
被Windows病毒和威胁保护阻止,一旦我允许它,它开始正常工作。