Problem with building Android app

Running into problems? This is a good place to get technical assistance for anything that isn't considered a bug.
den_gvrv
Posts: 2
Joined: Thu Sep 02, 2021 4:41 pm

Problem with building Android app

Post by den_gvrv »

Hi
We are going to use your plugin in our game. The goal is to create an Apple Arcade game out of the existing one, which is cross-platform (iOS/Android). We are working on removing all non-Apple features, but we still need the ability to build Android APKs by now since for our team it is easier to test some features on Android.
So, I added the plugin to Unity project, tried to build Android app and ran into this exception:

Code: Select all

Exception: Unknown CPU architecture  for library Packages/com.hovelhouse.cloudkit/Runtime/bin/TVOS/libHHCloudKitTVOS.a
  at UnityEditor.Android.PostProcessor.Tasks.NativePlugins.ProcessPlugin (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String pluginPath, System.String pluginTargetCPU) [0x001fc] in <267278aa48b840c7a0e7281223ea050e>:0 
  at UnityEditor.Android.PostProcessor.Tasks.NativePlugins.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x0020c] in <267278aa48b840c7a0e7281223ea050e>:0 
  at UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x00074] in <267278aa48b840c7a0e7281223ea050e>:0 
  at UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) [0x00273] in <267278aa48b840c7a0e7281223ea050e>:0 
  at UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) [0x00001] in <267278aa48b840c7a0e7281223ea050e>:0 
  at UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) [0x000da] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\PostprocessBuildPlayer.cs:288 
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
UnityEditor.BuildPipeline:BuildPlayerInternal(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline.bindings.cs:358)
UnityEditor.BuildPipeline:BuildPlayer(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline.bindings.cs:257)
UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline.bindings.cs:240)
I have never experienced this kind of issue with plugins before.
Could you provide the solution? Or is there a way to exclude libraries depending on the target platform I don't know about? Unfortunately I have not succeeded in finding any solution on the Internet.

Thank you

admin
Site Admin
Posts: 49
Joined: Thu Mar 19, 2020 8:52 pm

Re: Problem with building Android app

Post by admin »

Admittedly checking that the project compiles when the build target is android is not a use case we had considered. Since the plugin is not capable of running on that target. Clearly this was an error in judgement. We will fix this in the next update.

Unity's settings for the library file are probably defaulting to their most permissive (any platform, any CPU)

There is a way to exclude those libraries from being included in the android build. If you navigate to the library binaries in /packages/Cloud Kit Plugin/Runtime/Bin there will be three folders, one for each iOS target. Clicking on the library in each will bring up some options in the inspector panel.

You should be able to unselect the android platform from there. Note that these settings are saved on a per-target basis, so whatever values you set here will not apply when you switch your build target back to iOS. That should get you up and running. Let me know how that goes. We will verify this on our end shortly.
Screen Shot 2021-09-02 at 10.37.18 AM.png
Screen Shot 2021-09-02 at 10.37.18 AM.png (44.64 KiB) Viewed 26553 times

den_gvrv
Posts: 2
Joined: Thu Sep 02, 2021 4:41 pm

Re: Problem with building Android app

Post by den_gvrv »

Thank you for your quick reply.

Your tip worked well. Although I did not check the case with switching between target platforms since we use build automation solution with separate instances of Unity set up for each platform. And now it performs properly both on Android and iOS.

Post Reply