Skip to content

Commit 237169f

Browse files
author
Bin Zhang
authored
Merge pull request #412 from natural-law/solve-gradle-error
Solve the arguments error when using gradle.
2 parents 252abd4 + af7fd0f commit 237169f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/plugin_compile/build_android.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,11 @@ def gradle_build_apk(self, build_mode, android_platform, compile_obj):
494494
AndroidBuilder.GRADLE_PROP_NDK_MODE: self.ndk_mode
495495
}
496496
if android_platform:
497-
add_props[AndroidBuilder.GRADLE_PROP_TARGET_VERSION] = android_platform
497+
ret = self.check_android_platform(self.sdk_root, android_platform, None)
498+
pattern = r'android-(\d+)'
499+
match = re.match(pattern, ret)
500+
if match:
501+
add_props[AndroidBuilder.GRADLE_PROP_TARGET_VERSION] = (int)(match.group(1))
498502

499503
if self.app_abi:
500504
add_props[AndroidBuilder.GRADLE_PROP_APP_ABI] = ':'.join(self.app_abi.split(' '))

0 commit comments

Comments
 (0)