AndroidDependencyResolver: fixed NPE
This commit is contained in:
+7
-5
@@ -126,11 +126,13 @@ object AndroidDependencyResolver {
|
|||||||
if (entry.key == "androidMain") {
|
if (entry.key == "androidMain") {
|
||||||
// this is a terrible hack, but looks like the only way, other than proper support via light-classes
|
// this is a terrible hack, but looks like the only way, other than proper support via light-classes
|
||||||
val task = project.tasks.findByName("processDebugResources")
|
val task = project.tasks.findByName("processDebugResources")
|
||||||
getClassOrNull("com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask")?.let { linkAppClass ->
|
if (task != null) {
|
||||||
@Suppress("UNCHECKED_CAST")
|
getClassOrNull("com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask")?.let { linkAppClass ->
|
||||||
val rClassOutputJar =
|
@Suppress("UNCHECKED_CAST")
|
||||||
linkAppClass.getMethodOrNull("getRClassOutputJar")?.invoke(task) as Provider<FileSystemLocation>?
|
val rClassOutputJar =
|
||||||
rClassOutputJar?.orNull?.asFile?.let { result += AndroidDependency("R.jar", it) }
|
linkAppClass.getMethodOrNull("getRClassOutputJar")?.invoke(task) as Provider<FileSystemLocation>?
|
||||||
|
rClassOutputJar?.orNull?.asFile?.let { result += AndroidDependency("R.jar", it) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user