use of com.android.tools.idea.gradle.structure.editors.AndroidProjectSettingsService in project android by JetBrains.
the class RenderService method getPlatform.
@Nullable
private static AndroidPlatform getPlatform(@NotNull final Module module, @Nullable RenderLogger logger) {
AndroidPlatform platform = AndroidPlatform.getInstance(module);
if (platform == null && logger != null) {
if (!AndroidMavenUtil.isMavenizedModule(module)) {
RenderProblem.Html message = RenderProblem.create(ERROR);
logger.addMessage(message);
message.getHtmlBuilder().addLink("No Android SDK found. Please ", "configure", " an Android SDK.", logger.getLinkManager().createRunnableLink(() -> {
Project project = module.getProject();
ProjectSettingsService service = ProjectSettingsService.getInstance(project);
if (AndroidProjectInfo.getInstance(project).requiresAndroidModel() && service instanceof AndroidProjectSettingsService) {
((AndroidProjectSettingsService) service).openSdkSettings();
return;
}
AndroidSdkUtils.openModuleDependenciesConfigurable(module);
}));
} else {
String message = AndroidBundle.message("android.maven.cannot.parse.android.sdk.error", module.getName());
logger.addMessage(RenderProblem.createPlain(ERROR, message));
}
}
return platform;
}
use of com.android.tools.idea.gradle.structure.editors.AndroidProjectSettingsService in project android by JetBrains.
the class GradleApkProvider method validate.
@NotNull
@Override
public List<ValidationError> validate() {
AndroidModuleModel androidModuleModel = AndroidModuleModel.get(myFacet);
// This is a Gradle project, there must be an AndroidGradleModel.
assert androidModuleModel != null;
if (androidModuleModel.getMainArtifact().isSigned()) {
return ImmutableList.of();
}
AndroidArtifactOutput output = GradleUtil.getOutput(androidModuleModel.getMainArtifact());
final String message = AndroidBundle.message("run.error.apk.not.signed", output.getMainOutputFile().getOutputFile().getName(), androidModuleModel.getSelectedVariant().getDisplayName());
Runnable quickFix = new Runnable() {
@Override
public void run() {
Module module = myFacet.getModule();
ProjectSettingsService service = ProjectSettingsService.getInstance(module.getProject());
if (service instanceof AndroidProjectSettingsService) {
((AndroidProjectSettingsService) service).openSigningConfiguration(module);
} else {
service.openModuleSettings(module);
}
}
};
return ImmutableList.of(ValidationError.fatal(message, quickFix));
}
Aggregations