First of all, provide a link to download the Demo that integrates Huawei services in Unity. You can try to access it first
Github.com/Unity-Techn…
1. Illegal dependency error is reported when Demo is opened with Unity
Project has invaild Dependenciess: com.unity. Textmeshpro: Connect ETIMEDOUT 172.81.232.209:443 com.Unity. The connect ETIMEDOUT 172.81.232.209:443Copy the code
You can ignore the problem at this point and click Continue to enter the project. Then inside the project, click Window-Package Management
Find the package you want to Update and click Update to Update to the latest version.
2. Switch to Android
Select File-Build Setting, select Android, and click Switch Platform to Switch to Android
3. Visual C# Compiler version error is reported after switching Android platform
If the following error occurs, you can ignore it. Close the project and open it again to resolve the problem
Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Cpoyright(C) Microsoft Corporation. All right reserved.
Copy the code
4. Package the operations needed to run the Demo project
From the Build Setting screen, click Player Settting to enter the project Settings screen.
First, set the Product Name to the Name you want
Then, in Other Setting, configure Package Name, which is the Package Name of the Android application and must be consistent with the Name in the JSON file of the AGC.
In Publish Setting, uncheck Custom KeyStore. (This is only for AGC’s 9 services that do not require signatures, if signatures are involved, complete the operations related to signature generation.)
Finally, download the JSON file from the AGC interface and place it in the project’s.. Under the \ Assets \ Plugins \ Android path
Dorg.gradle.jvmargs= -xmx4096m “”assembleDebug”
In Build Setting, select the corresponding device and click Build and Run. The following error will be reported.
org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"
stderr[
Picked up JAVA_TOOLOPTIONS: Dfile.encoding=UTF-8
Copy the code
This problem is caused by canceling the corresponding signature file and then using it in the Gradle file.
To solve the problem, open the.. In the launcherTemplate.gradle file under \Assets\Plugins\Android, find the following code snippet and comment it out:
Launcher release. Apk does not exist
Temp\gradleOut\launcher\build\outputs\apk\release\launcher-release.apk does not exist
System.IO.File.Move(System.String.sourceFileName, System.String destFileName)
Copy the code
To solve this problem, you need to check the options shown below when packing
The original link: developer.huawei.com/consumer/cn…
Original author: Mayism