Android Studio 初めてのHelloWorldアプリ作成で、Plugin was not foundエラーが起きる

Android Studioが初めてなので、テンプレート通りにアプリを作成したいのですが、そこまで行きつかないです。初心者質問ですが教えていただけますでしょうか。

実現したいこと

HelloWorldを表示するAndroidアプリ(apkファイル)を作成したい。
その中でまず、PC画面上でエミュレータを表示させるところまで実施したい。

前提

Androidstudioで新しいプロジェクト作成より、テンプレートの中からEmptyActivityを選択し、作られると以下エラーが表示される。

発生している問題・エラーメッセージ

Plugin [id: 'org.jetbrains.kotlin.android', version: '1.8.10', apply: false] was not found in any of the following sources:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

該当のソースコード

package com.example.sampleproject

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.sampleproject.ui.theme.SampleProjectTheme

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
SampleProjectTheme {
// A surface container using the 'background' color from the theme
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
Greeting("Android")
}
}
}
}
}

@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Text(
text = "Hello $name!",
modifier = modifier
)
}

@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
SampleProjectTheme {
Greeting("Android")
}
}

補足情報(FW/ツールのバージョンなど)

●Androidstudioのバージョン
Android Studio Giraffe | 2022.3.1 Patch 2
Build #AI-223.8836.35.2231.10811636, built on September 15, 2023
Non-Bundled Plugins:
com.intellij.ja (223.228)

コメントを投稿

0 コメント