Skip to content

Commit 726d800

Browse files
committed
up to date with gradle
1 parent c6f2a36 commit 726d800

File tree

2 files changed

+7
-30
lines changed

2 files changed

+7
-30
lines changed

Assets/AndroidIl2cppPatchDemo/Editor/AndroidBuilder.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99

1010
public class AndroidBuilder : MonoBehaviour {
1111

12-
//----------------------------------------- config ---------------------------------
13-
//set SDK/NDK/JDK via Unity Menu Path: Edit -> Preferences... -> External Tools -> Android
14-
public static readonly string ANDROID_BUILD_TOOLS_VERSION = "26.0.2";
15-
public static readonly string ANDROID_PLATFORM = "android-23";
16-
1712
//-----------------------------------------------------------------------------------
1813
public static readonly string PROJECT_DIR = Application.dataPath.Substring(0, Application.dataPath.Length - 6);
1914
public static readonly string ANDROID_EXPORT_PATH = PROJECT_DIR + "/AndroidGradleProject_v1.0";
@@ -98,26 +93,10 @@ public static bool ValidateConfig()
9893
}
9994
}
10095

101-
string buildToolPath = sdkPath + "/build-tools/" + ANDROID_BUILD_TOOLS_VERSION + "/";
102-
if (!Directory.Exists(buildToolPath))
103-
{
104-
Debug.LogError("Android Build Tools not found. Try to reconfig version on the top of AndroidBuilder.cs. In Unity2018, it can't be work if less than 26.0.2. current:" + buildToolPath);
105-
return false;
106-
}
107-
108-
string platformJar = sdkPath + "/platforms/" + ANDROID_PLATFORM + "/android.jar";
109-
if (!File.Exists(platformJar))
110-
{
111-
Debug.LogError("Android Platform not found. Try to reconfig version on the top of AndroidBuilder.cs. current:" + platformJar);
112-
return false;
113-
}
114-
11596
Debug.Log("Build Env is ready!");
11697
Debug.Log("Build Options:");
11798
Debug.Log("SDK PATH=" + sdkPath);
11899
Debug.Log("JDK PATH=" + jdkPath);
119-
Debug.Log("BUILD TOOLS PATH=" + buildToolPath);
120-
Debug.Log("ANDROID PLATFORM=" + platformJar);
121100
return true;
122101
}
123102

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,15 @@ Unity在以il2cpp方式导出Android工程(或者Apk文件)的时候,代
110110
### 依赖
111111

112112
* Unity (我用Unity2017/Unity2018/Unity2019)
113-
* JDK.(我用JDK1.8)
114-
* Android SDK.(我用Android SDK platform 23 和 build tools 26.0.2(低于26.0.2,Unity2018不支持),最好是这两个版本,不然得重新下载)
115-
* Android NDK r16b.
113+
* Unity2019.4 自带的JDK,SDK,NDK
116114
* Git
117115

118116
### Build指引
119117

120118
* 1. 在Unity中(**Edit**->**Preference**->**External tools**)设置好 JDK/SDK/NDK 路径,打包代码里会从Unity中读取。
121-
* 2. 如果你的Android SDK的build tools版本不是26.0.2,需要修改代码 AndroidBuilder.cs,第14行.
122-
* 3. 如果你使用的Android platform不是android-23,修改代码 AndroidBuilder.cs,第15行.
123-
* 4. 出母包,执行菜单 **AndroidBuilder**->**Run Step 1, 2, 4, 5 for base version**, 成功后会弹出文件管理器显示apk所在的目录.
124-
* 5. 一般来说你不需要打Patch文件,如果要打,用git checkout version1或version2,执行菜单 **AndroidBuilder**->**Run Step 1-4 for Patch Version**。PrebuildPatches目录下的相应文件会被更新。
119+
* 2. 确保gradle能正常工作(Unity内能正常导出apk)
120+
* 3. 出母包,执行菜单 **AndroidBuilder**->**Run Step 1, 2, 4, 5 for base version**, 成功后会弹出文件管理器显示apk所在的目录.
121+
* 4. 一般来说你不需要打Patch文件,如果要打,用git checkout version1或version2,执行菜单 **AndroidBuilder**->**Run Step 1-4 for Patch Version**。PrebuildPatches目录下的相应文件会被更新。
125122

126123
# 5. 剩下的工作和建议
127124
打包部分
@@ -164,8 +161,9 @@ MIT license.
164161
# 8.调试和遗留问题
165162
* 1. 集成中如果有问题,先看看Demo的[release版本](https://github.com/noodle1983/UnityAndroidIl2cppPatchDemo/releases)有没有问题。如果Demo有问题,直接找我吧,QQ或邮件都行。
166163
* 2. 如果感兴趣,可以在[log.h](https://github.com/noodle1983/UnityAndroidIl2cppPatchDemo-libboostrap/blob/master/log.h)里,把日志全开,会有一些很有意思的日志,对理解原理和调试都很有用。
167-
* 3. Q群:593413410
168-
* 4. 遗留问题见[Github Issues](https://github.com/noodle1983/UnityAndroidIl2cppPatchDemo/issues)
164+
* 3. Android obb的支持,欢迎pull request,提供支持
165+
* 4. Q群:593413410
166+
* 5. 遗留问题见[Github Issues](https://github.com/noodle1983/UnityAndroidIl2cppPatchDemo/issues)
169167

170168
# 9.支持
171169

0 commit comments

Comments
 (0)