From 36e1ae04fd3cb5234ecade657c8c2a8dac98f200 Mon Sep 17 00:00:00 2001 From: Parthiv Mangukiya Date: Wed, 28 Mar 2018 01:45:18 +0530 Subject: [PATCH] fix: APK Generator is unable to find build tools version. (#2401) --- apk-generator/v2/app/generator/generator.py | 2 +- apk-generator/v2/app/utils/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apk-generator/v2/app/generator/generator.py b/apk-generator/v2/app/generator/generator.py index 48774040c..e43546b9d 100644 --- a/apk-generator/v2/app/generator/generator.py +++ b/apk-generator/v2/app/generator/generator.py @@ -186,7 +186,7 @@ def generate(self, should_notify=True): self.update_status('Preparing android build tools') - build_tools_version = get_build_tools_version(self.get_path('app/build.gradle')) + build_tools_version = get_build_tools_version(self.get_path('build.gradle')) logger.info('Detected build tools version: %s' % build_tools_version) diff --git a/apk-generator/v2/app/utils/__init__.py b/apk-generator/v2/app/utils/__init__.py index cf62555f7..109a6a8af 100644 --- a/apk-generator/v2/app/utils/__init__.py +++ b/apk-generator/v2/app/utils/__init__.py @@ -43,8 +43,8 @@ def get_build_tools_version(build_gradle_path): version = None with open(build_gradle_path) as f: for line in f: - if "buildToolsVersion" in line: - version = line.replace('buildToolsVersion', '').replace('"', '').replace('\'', '').strip() + if "project.ext.buildTools" in line: + version = line.replace('project.ext.buildTools', '').replace('=','').replace('"', '').replace('\'', '').strip() return version