First, provide a demo download link for integrating Huawei services in Unity, you can try to access it first
https://github.com/Unity-Technologies/HuaweiServiceSample
1. Use Unity to open the Demo and report an illegal dependency error
Project has invaild dependenciess:
com.unity.textmeshpro: connect ETIMEDOUT 172.81.232.209:443
com.unity.timeline: connect ETIMEDOUT 172.81.232.209:443
At this time, you can ignore the problem and click Continue to enter the project. Then inside the project, click Window-Package Management
Find the package that needs to be updated and click Update to update to the latest version.
2. Switch Android platform
Select File-Build Setting, select Android, click Switch Platform, switch to Android
3. After switching the Android platform, a Visual C# Compiler version error is reported
At this time, there are the following errors, you can ignore them directly, close the project, and reopen it to solve the problem
Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Cpoyright(C) Microsoft Corporation. All right reserved.
4. Pack and run the required operations of the Demo project
On the Build Setting interface, click Player Settting to enter the project setting page,
First, configure the Product Name, which is the name you need
Then, in Other Setting, configure the Package Name. This name is the package name of the Android application and needs to be consistent with the name in the AGC json file.
In Publish Setting, uncheck Custom KeyStore. (Here is only for the 9 AGC services that do not require signatures. If signatures are involved, please complete the relevant operations for generating signatures)
Finally, download the json file on the AGC interface and put it under the path of ..\Assets\Plugins\Android of the project
5. An error is reported when packaging Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"
In Build Setting, select the corresponding device, click Build and run, the following error will be reported at this time,
org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"
stderr[
Picked up JAVA_TOOLOPTIONS: Dfile.encoding=UTF-8
This problem is caused by we canceled the corresponding signature file, but used it in the gradle file.
To solve this problem, you need to open the launcherTemplate.gradle file under the path ..\Assets\Plugins\Android, find the following code snippet, and comment it:
6. An error message launcher-release.apk does not exist when packaging
Temp\gradleOut\launcher\build\outputs\apk\release\launcher-release.apk does not exist
System.IO.File.Move(System.String.sourceFileName, System.String destFileName)
To solve this problem: when packaging, check the options in the figure below
Original link: https://developer.huawei.com/consumer/cn/forum/topic/0203477564318780394?fid=0101271690375130218
Original Author: Mayism
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。