AppCenter 未构建 Android App Bundle (aab)
AppCenter doesn't build an Android App Bundle (aab)
我创建了一个 Xamarin Forms 应用程序,当它在我的计算机上构建时,它会生成一个 AAB。当我启用签名时,AAB 文件被 Google Play 商店接受并可以发布。
AppCenter 已设置为构建相同的解决方案,我启用了构建 Android App Bundle 的选项(可通过 Build 中的扳手图标获得将鼠标悬停在分支上时的选项卡):
当我查看构建日志时,它似乎确实构建了 Android App Bundle:
...
##[section]Finishing: Build Xamarin.Android project
##[section]Starting: Sign Android App Bundle
==============================================================================
Task : Android Signing
Description : Sign and align Android APK files
Version : 1.122.0
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613717)
==============================================================================
(node:1767) Warning: Use Cipheriv for counter mode of aes-256-ctr (repeated 11 times)
[command]/usr/bin/jarsigner -keystore /Users/runner/runners/2.170.0/work/1/s/.certs/keystore.jks -storepass *** -keypass *** -verbose -sigalg SHA256withRSA -digestalg SHA-256 -signedjar /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab.unsigned ***
adding: META-INF/CPANDROI.SF
adding: META-INF/CPANDROI.RSA
signing: BundleConfig.pb
... (removed a lot of files from the logging)
signing: base/manifest/AndroidManifest.xml
signing: base/native.pb
signing: base/resources.pb
>>> Signer
X.509, CN="REMOVED, O=REMOVED, L=REMOVED, S=REMOVED, C=NL"
[trusted certificate]
jar signed.
Warning:
The signer's certificate is self-signed.
[command]/Users/runner/Library/Android/sdk/build-tools/24.0.0/zipalign -v 4 /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab.unaligned /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab
Verifying alignment of /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab (4)...
50 META-INF/MANIFEST.MF (OK - compressed)
27883 META-INF/CPANDROI.SF (OK - compressed)
56907 META-INF/CPANDROI.RSA (OK - compressed)
... (removed a lot of files from the logging)
13130472 base/manifest/AndroidManifest.xml (OK - compressed)
13132552 base/native.pb (OK - compressed)
13132664 base/resources.pb (OK - compressed)
Verification succesful
##[section]Finishing: Sign Android App Bundle
##[section]Starting: Sign APK
我想构建和签名都很好,但我想在 将捆绑文件复制到暂存 阶段出现了问题。在此之前 Copy build files to staging 阶段运行并显示以下输出:
##[section]Starting: Copy build files to staging
==============================================================================
Task : Command Line
Description : Run a command line with arguments
Version : 1.1.3
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
[command]/bin/bash -c /usr/bin/find . -path '*/bin/*' ! -path '*/obj/*' -type f ! -name '*-Signed.apk' ! -name '*-armeabi-v7a.apk' ! -name '*-arm64-v8a.apk' ! -name '*-x86.apk' ! -name '*-x86_64.apk' -name '*.apk' -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -1 | cut -f2- -d" " | xargs -L 1 -I{} cp -R -v {} /Users/runner/runners/2.170.0/work/1/a/build
(node:1777) Warning: Use Cipheriv for counter mode of aes-256-ctr (11 times)
./CrossPoint.Xpact.Android/bin/Release/com.example.test.apk -> /Users/runner/runners/2.170.0/work/1/a/build/com.example.test.apk
##[section]Finishing: Copy build files to staging
它似乎将 APK 复制到暂存文件夹,然后它尝试对 Android App Bundle (AAB) 执行相同的操作:
##[section]Starting: Copy bundle files to staging
==============================================================================
Task : Command Line
Description : Run a command line with arguments
Version : 1.1.3
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
[command]/bin/bash -c mkdir -p /Users/runner/runners/2.170.0/work/1/a/bundle && ls -LR && /usr/bin/find . -path '*/obj/*' -type f -name '*.aab' -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -1 | cut -f2- -d" " | xargs -L 1 -I{} cp -R -v {} /Users/runner/runners/2.170.0/work/1/a/bundle
(node:1787) Warning: Use Cipheriv for counter mode of aes-256-ctr (11 times)
Example.Common.DataTypes
Example.Identity.Common
Example.Test
Example.Test.Android
Example.Test.UWP
Example.Test.iOS
Example.Test.sln
Example.ruleset
./Example.Common.DataTypes:
ExampleType.cs
Example.Common.DataTypes.csproj
AnotherType.cs
bin
obj
... (whole lot of files removed from this logging)
./Example.Test.iOS/obj:
Example.Test.iOS.csproj.nuget.dgspec.json
Example.Test.iOS.csproj.nuget.g.props
Example.Test.iOS.csproj.nuget.g.targets
project.assets.json
project.nuget.cache
##[section]Finishing: Copy bundle files to staging
它似乎转储了所有文件,但它没有复制实际的 AAB 文件。我不确定为什么找不到 AAB 文件,因为它似乎确实在 obj 文件夹中创建了 AAB 文件。这显示在 Build bundle from Xamarin.Android project 阶段:
_BuildApkEmbed:
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java -Xmx1G -jar /Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/bundletool.jar build-bundle --modules obj/Release/android/bin/base.zip --output obj/Release/android/bin/com.example.test.aab --config /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpb29e9af.tmp
_CopyPackage:
Copying file from "/Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/obj/Release/android/bin/com.example.test.aab" to "/Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test.aab".
_CreateAndroidDebugSigningKey:
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/keytool -genkeypair -alias androiddebugkey -storepass android -keypass android -keystore "/Users/runner/.local/share/Xamarin/Mono for Android/debug.keystore" -dname "CN=Android Debug,O=Android,C=US" -keyalg RSA -validity 10950 -storetype pkcs12
_ResolveAndroidSigningKey:
Creating "obj/Release/android_debug_keystore.flag" because "AlwaysCreate" was specified.
_Sign:
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/jarsigner -keystore "/Users/runner/.local/share/Xamarin/Mono for Android/debug.keystore" -storepass android -keypass android -digestalg SHA-256 -sigalg SHA256withRSA -signedjar bin/Release/com.example.test-Signed.aab /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/obj/Release/android/bin/com.example.test.aab androiddebugkey
jar signed.
The signer's certificate is self-signed.
Signed android package ''
Done Building Project "/Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/Example.Test.Android.csproj" (PackageForAndroid;SignAndroidPackage target(s)).
Build succeeded.
我不知道哪里出了问题,也不知道为什么最后一步会转储我的所有文件,而不是将 AAB 复制到暂存文件夹。
发布此作为答案,因为我无法在评论中分享图片。
您似乎没有任何错误。在Distribute页面查看构建时,尝试点击download下拉按钮,是否可以看到download bundle按钮,如图:
如果是这样,只需下载捆绑包,这就是您的 AAB 文件。
AppCenter 支持人员确认了该问题并提交了错误报告。它只发生在 Xamarin 10.3 中,降级到 Xamarin 10.2 确实解决了这个问题。 2020 年 6 月 16 日,我收到一封电子邮件,告知该错误已得到修复,现在它也可以再次与 Xamarin 10.3 一起使用。
我创建了一个 Xamarin Forms 应用程序,当它在我的计算机上构建时,它会生成一个 AAB。当我启用签名时,AAB 文件被 Google Play 商店接受并可以发布。
AppCenter 已设置为构建相同的解决方案,我启用了构建 Android App Bundle 的选项(可通过 Build 中的扳手图标获得将鼠标悬停在分支上时的选项卡):
当我查看构建日志时,它似乎确实构建了 Android App Bundle:
...
##[section]Finishing: Build Xamarin.Android project
##[section]Starting: Sign Android App Bundle
==============================================================================
Task : Android Signing
Description : Sign and align Android APK files
Version : 1.122.0
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613717)
==============================================================================
(node:1767) Warning: Use Cipheriv for counter mode of aes-256-ctr (repeated 11 times)
[command]/usr/bin/jarsigner -keystore /Users/runner/runners/2.170.0/work/1/s/.certs/keystore.jks -storepass *** -keypass *** -verbose -sigalg SHA256withRSA -digestalg SHA-256 -signedjar /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab.unsigned ***
adding: META-INF/CPANDROI.SF
adding: META-INF/CPANDROI.RSA
signing: BundleConfig.pb
... (removed a lot of files from the logging)
signing: base/manifest/AndroidManifest.xml
signing: base/native.pb
signing: base/resources.pb
>>> Signer
X.509, CN="REMOVED, O=REMOVED, L=REMOVED, S=REMOVED, C=NL"
[trusted certificate]
jar signed.
Warning:
The signer's certificate is self-signed.
[command]/Users/runner/Library/Android/sdk/build-tools/24.0.0/zipalign -v 4 /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab.unaligned /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab
Verifying alignment of /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test-Signed.aab (4)...
50 META-INF/MANIFEST.MF (OK - compressed)
27883 META-INF/CPANDROI.SF (OK - compressed)
56907 META-INF/CPANDROI.RSA (OK - compressed)
... (removed a lot of files from the logging)
13130472 base/manifest/AndroidManifest.xml (OK - compressed)
13132552 base/native.pb (OK - compressed)
13132664 base/resources.pb (OK - compressed)
Verification succesful
##[section]Finishing: Sign Android App Bundle
##[section]Starting: Sign APK
我想构建和签名都很好,但我想在 将捆绑文件复制到暂存 阶段出现了问题。在此之前 Copy build files to staging 阶段运行并显示以下输出:
##[section]Starting: Copy build files to staging
==============================================================================
Task : Command Line
Description : Run a command line with arguments
Version : 1.1.3
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
[command]/bin/bash -c /usr/bin/find . -path '*/bin/*' ! -path '*/obj/*' -type f ! -name '*-Signed.apk' ! -name '*-armeabi-v7a.apk' ! -name '*-arm64-v8a.apk' ! -name '*-x86.apk' ! -name '*-x86_64.apk' -name '*.apk' -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -1 | cut -f2- -d" " | xargs -L 1 -I{} cp -R -v {} /Users/runner/runners/2.170.0/work/1/a/build
(node:1777) Warning: Use Cipheriv for counter mode of aes-256-ctr (11 times)
./CrossPoint.Xpact.Android/bin/Release/com.example.test.apk -> /Users/runner/runners/2.170.0/work/1/a/build/com.example.test.apk
##[section]Finishing: Copy build files to staging
它似乎将 APK 复制到暂存文件夹,然后它尝试对 Android App Bundle (AAB) 执行相同的操作:
##[section]Starting: Copy bundle files to staging
==============================================================================
Task : Command Line
Description : Run a command line with arguments
Version : 1.1.3
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
[command]/bin/bash -c mkdir -p /Users/runner/runners/2.170.0/work/1/a/bundle && ls -LR && /usr/bin/find . -path '*/obj/*' -type f -name '*.aab' -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -1 | cut -f2- -d" " | xargs -L 1 -I{} cp -R -v {} /Users/runner/runners/2.170.0/work/1/a/bundle
(node:1787) Warning: Use Cipheriv for counter mode of aes-256-ctr (11 times)
Example.Common.DataTypes
Example.Identity.Common
Example.Test
Example.Test.Android
Example.Test.UWP
Example.Test.iOS
Example.Test.sln
Example.ruleset
./Example.Common.DataTypes:
ExampleType.cs
Example.Common.DataTypes.csproj
AnotherType.cs
bin
obj
... (whole lot of files removed from this logging)
./Example.Test.iOS/obj:
Example.Test.iOS.csproj.nuget.dgspec.json
Example.Test.iOS.csproj.nuget.g.props
Example.Test.iOS.csproj.nuget.g.targets
project.assets.json
project.nuget.cache
##[section]Finishing: Copy bundle files to staging
它似乎转储了所有文件,但它没有复制实际的 AAB 文件。我不确定为什么找不到 AAB 文件,因为它似乎确实在 obj 文件夹中创建了 AAB 文件。这显示在 Build bundle from Xamarin.Android project 阶段:
_BuildApkEmbed:
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java -Xmx1G -jar /Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/bundletool.jar build-bundle --modules obj/Release/android/bin/base.zip --output obj/Release/android/bin/com.example.test.aab --config /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpb29e9af.tmp
_CopyPackage:
Copying file from "/Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/obj/Release/android/bin/com.example.test.aab" to "/Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/bin/Release/com.example.test.aab".
_CreateAndroidDebugSigningKey:
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/keytool -genkeypair -alias androiddebugkey -storepass android -keypass android -keystore "/Users/runner/.local/share/Xamarin/Mono for Android/debug.keystore" -dname "CN=Android Debug,O=Android,C=US" -keyalg RSA -validity 10950 -storetype pkcs12
_ResolveAndroidSigningKey:
Creating "obj/Release/android_debug_keystore.flag" because "AlwaysCreate" was specified.
_Sign:
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/jarsigner -keystore "/Users/runner/.local/share/Xamarin/Mono for Android/debug.keystore" -storepass android -keypass android -digestalg SHA-256 -sigalg SHA256withRSA -signedjar bin/Release/com.example.test-Signed.aab /Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/obj/Release/android/bin/com.example.test.aab androiddebugkey
jar signed.
The signer's certificate is self-signed.
Signed android package ''
Done Building Project "/Users/runner/runners/2.170.0/work/1/s/Example.Test.Android/Example.Test.Android.csproj" (PackageForAndroid;SignAndroidPackage target(s)).
Build succeeded.
我不知道哪里出了问题,也不知道为什么最后一步会转储我的所有文件,而不是将 AAB 复制到暂存文件夹。
发布此作为答案,因为我无法在评论中分享图片。
您似乎没有任何错误。在Distribute页面查看构建时,尝试点击download下拉按钮,是否可以看到download bundle按钮,如图:
如果是这样,只需下载捆绑包,这就是您的 AAB 文件。
AppCenter 支持人员确认了该问题并提交了错误报告。它只发生在 Xamarin 10.3 中,降级到 Xamarin 10.2 确实解决了这个问题。 2020 年 6 月 16 日,我收到一封电子邮件,告知该错误已得到修复,现在它也可以再次与 Xamarin 10.3 一起使用。