diff --git a/android/gradle/generate_gradle.py b/android/gradle/generate_gradle.py index 546448258..ec50a247b 100755 --- a/android/gradle/generate_gradle.py +++ b/android/gradle/generate_gradle.py @@ -297,7 +297,8 @@ class _ProjectContextGenerator(object): def _Srcjars(self, entry): srcjars = _RebasePath(entry.Gradle().get('bundled_srcjars', [])) if not self.use_gradle_process_resources: - srcjars += _RebasePath(entry.BuildConfig()['javac']['srcjars']) + srcjars += _RebasePath(entry.Javac()['srcjars']) + srcjars += _RebasePath(entry.Gradle().get('srcjars')) return srcjars def _GetEntries(self, entry): diff --git a/android/gyp/write_build_config.py b/android/gyp/write_build_config.py index b90f06f8d..5c6c721ce 100755 --- a/android/gyp/write_build_config.py +++ b/android/gyp/write_build_config.py @@ -374,6 +374,7 @@ def main(argv): direct_library_deps = deps.Direct('java_library') all_library_deps = deps.All('java_library') + direct_resources_deps = deps.Direct('android_resources') all_resources_deps = deps.All('android_resources') # Resources should be ordered with the highest-level dependency first so that # overrides are done correctly. @@ -478,8 +479,11 @@ def main(argv): c['package_name'] for c in all_resources_deps if 'package_name' in c] if options.type == 'android_apk': - # Apks will get their resources srcjar explicitly passed to the java step. + # Apks will get their resources srcjar explicitly passed to the java step config['javac']['srcjars'] = [] + # Gradle may need to generate resources for some apks. + gradle['srcjars'] = [ + c['srcjar'] for c in direct_resources_deps if 'srcjar' in c] if options.type == 'android_assets': all_asset_sources = []