Configuration: Use model provider to access facets

Otherwise newly created Android project may get invalid SDK
until the reimport is performed

 #KT-27193 Fixed
This commit is contained in:
Alexey Sedunov
2018-10-01 13:13:29 +03:00
parent eb528c3d65
commit 99f63f2ebd
2 changed files with 4 additions and 2 deletions
@@ -231,7 +231,7 @@ private val CommonCompilerArguments.ignoredFields: List<String>
private fun Module.configureSdkIfPossible(compilerArguments: CommonCompilerArguments, modelsProvider: IdeModifiableModelsProvider) {
// SDK for Android module is already configured by Android plugin at this point
if (isAndroidModule()) return
if (isAndroidModule(modelsProvider)) return
val projectSdk = ProjectRootManager.getInstance(project).projectSdk
val allSdks = ProjectJdkTable.getInstance().allJdks