Ver Unity 2.1.1 To Ver Unity 2.1.2 Or New Version
[Unity 2019.02.XX 或更早版本]
- 以与以前相同的方式更新
[统一2019.3.0~2019.3.6]
保留之前使用的 settingsTemplate.gradle / mainTemplate.gradle 文件。
由于版本引擎的特性,加载外部库时存在限制。
我们建议使用不同版本的 Unity 插件。
[Unity 2019.3.7 或更高版本(如果是新的)]
▪︎ Applicable for GAMEPOT SDK ver 3.5.1
mainTemplate.gradle / launcherTemplate.gradle / baseProjectTemplate.gradle
注意以下幾點來執行文件替換
- [File]_GAMEPOT_UNITY_[Year]_[Mid]_[Minor version or higher]
- UNITY_2019_3_Over : 用於高於UNITY 2019.3.XX的版本
- UNITY_2020_XX_Over_2022_1_XX : 用於比UNITY_2020更高的版本 並低於UNITY_2022.1.XX。
- UNITY_2022_2_XX_Over : 用於高於2022.2.XX的版本
Delete the file named mainTemplate.gradle (as the existing file is only applicable for the Unity 2018)
Find and change the name of the mainTemplate.gradle that is compatible for the version of the Unity being developed on.
GAMEPOT’s environment variable will be declared on launcherTemplate, so that is not required to be done on the mainTemplate file. Used when declaring additional libraries.
case 1) For Unity editor version 2019.4.40
Change the file name from mainTemplate_GAMEPOT_UNITY_2019_3_Over to mainTemplate.gradle
case 2) For Unity editor version 2021.3.13
Change the file name from mainTemplate_GAMEPOT_UNITY_2020_XX_Over_2022_1_XX.gradle to mainTemplate.gradle
case 3) For Unity editor version 2022.3.00
Change the file name from mainTemplate_GAMEPOT_UNITY_2022_2_XX_Over to mainTemplate.gradle
Find and change the name of the file named launcherTemplate.gradle that is compatible for the version of the Unity being developed on.
Then, declare the GAMEPOT environment variables.
case 1) For Unity editor version 2019.4.40
Change the file name from launcherTemplate_GAMEPOT_UNITY_2019_3_Over to launcherTemplate.gradle
case 2) For Unity editor version 2021.3.13
Change the file name from launcherTemplate_GAMEPOT_UNITY_2020_XX_Over_2022_1_XX.gradle to launcherTemplate.gradle
case 3) For Unity editor version 2022.3.00
Change the file name from launcherTemplate_GAMEPOT_UNITY_2022_2_XX_Over to launcherTemplate.gradle
Find and change the name of the file named baseProjectTemplate.gradle that is compatible for the version of the Unity being developed on.
case 1) For Unity editor version 2019.4.40 Change the file name from baseProjectTemplate_GAMEPOT_UNITY_2019_X_XX to baseProjectTemplate.gradle case 2) For Unity editor version 2021.3.13 Change the file name from baseProjectTemplate_GAMEPOT_UNITY_2020_X_Over_2022_1_XX.gradle to baseProjectTemplate.gradle case 3) For Unity editor version 2022.3.00 Change the file name from baseProjectTemplate_GAMEPOT_UNITY_2022_2_XX_Over to baseProjectTemplate.gradle
Applicable for GAMEPOT SDK ver 3.4.2
添加baseProjectTemplate.gradle。
通常,您可以通过重命名来使用以下文件。 baseProjectTemplate_GAMEPOT_UNITY_2019_3_Over.gradle
=> baseProjectTemplate.gradle
删除settingsTemplate.gradle。 ../Assets/Plugins/Android/settingsTemplate.gradle
在launcherTemplate.gradle中定义mainTemplate.gradle文件中定义的gamepot_project_id等环境变量。
一般情况下,重命名以下文件后,定义gamepot环境变量值。
launcherTemplate_GAMEPOT_UNITY_2019_3_Over.gradle => launcherTemplate.gradle
参考mainTemplate_GAMEPOT_UNITY_2019_3_Over.gradle文件设置mainTemplate.gradle。
gamepot_project_id 等环境变量定义在 launcherTemplate.gradle 中,因此您可以删除它们。
使用 Unity 202X.X 版本时的其他修复
Unity 202X.X 版本补丁:下载
[替换文件夹和文件]
../Assets/ExternalDependencyManager
../Assets/Firebase
[Add Folders and Files]
../Assets/Parse
(optional) ../Assets/GooglePlayPlugins //com.google.android.appbundle-1.7.0.unitypackage
- 修改文件夹名称
现有 : ../Assets/Plugins/Android/Firebase
调整 : ../Assets/Plugins/Android/FirebaseApp.androidlib
现有 : ../Assets/Plugins/Android/GamePotResources
调整 : ../Assets/Plugins/Android/GamePotResources.androidlib
- 修改 mainTemplate.gradle(根据文件夹名称变化修改)
现有 :
dependencies {
...
implementation project('GamePotResources')
implementation project('Firebase')
调整 :
dependencies {
...
implementation project('GamePotResources.androidlib')
implementation project('FirebaseApp.androidlib')
aaptOptions {
noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ') // add
...
- 修改 launcherTemplate.gradle
aaptOptions {
noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]+ unityStreamingAssets.tokenize(', ') //add
...
- 设置为在构建 Android 时不包括 Unity 编辑器中 ../Assets/Plugins/Android/nativeLibs 文件夹中的所有库。
参考图片:
When "Please fix your Bundle ID" pop-up appears, check the package name and click the Apply button.
After recognizing google-services.json or GoogleService-Info.plist from the google android resolver
library, you must accept it with a pop-up confirming whether to parse it, so that Google-related actions are performed normally.
In the Unity Editor 2021.X version, manually enter the package name in the
Build Settings > Player Settings > Other Settings menu for Android / IOS, and then build after Switch Platform with the OS you want to build.
If the above operation is not done in advance, please fix your Bundle ID popup due to a bug inside the google resolver
library > Ambiguous match found error occurs when clicking the Apply button and does not work
Related: https://github.com/googlesamples/unity-jar-resolver/issues/523#issuecomment-1147499484
Sample scene file replacement in Unity Editor 2021.X version:Download
Note :
If the following error occurs in the Android version build environment in Unity Editor 2019.X or lower version,
[error phrase]
System.TypeLoadException: Could not resolve type with token 01000074 (from typeref, class/assembly Google.EditorInitializer, Google.VersionHandlerImpl, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[]) (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:138)
Patch Download Please check after modifying as follows.
[Replace Folders and Files]
../Assets/ExternalDependencyManager
../Assets/Firebase
- Modify folder name
Existing: ../Assets/Plugins/Android/Firebase
EDIT: ../Assets/Plugins/Android/FirebaseApp.androidlib
- Edit mainTemplate.gradle (modified according to folder name change)
existing :
dependencies {
...
implementation project('Firebase')
Modify :
dependencies {
...
implementation project('FirebaseApp.androidlib')
...
(Based on macOS Monterey 12.3) If the following error occurs when building Unity, refer to the following and replace the file in ./Assets/Firebase/Editor.
https://github.com/techyworm10/firebase-unity-sdk-editor-python-fix
Download the patch file, unzip it, and put it in the /Assets/Firebase/Editor folder (replace the Firebase.Editor.dll file).
[Error phrase]
Unable to find command line tool python required for Firebase Android resource generation.
python is required to generate the Firebase Android resource file google-services.xml from Assets/Plugins/Android/google-services.json. Without Firebase Android resources, your app will fail to initialize.
python was distributed with each Firebase Unity SDK plugin, was it deleted?
System.ComponentModel.Win32Exception (0x80004005): ApplicationName='python',
Last updated