2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AndroidStudio FlamingoでRealmを使う

Posted at

1.Projectのbuildgradleにbuildscript{}を作る

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "io.realm:realm-gradle-plugin:10.15.1"
    }
}

plugins {
    id 'com.android.application' version '8.0.2' apply false
    id 'com.android.library' version '8.0.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.20' apply false

    id 'io.realm.kotlin' version '1.9.1' apply false
}

2.appのbuild.gradleにapply plugin: 'realm-android'を入れる

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'org.jetbrains.kotlin.kapt'
    id 'io.realm.kotlin'
}
apply plugin: 'kotlin-kapt'
apply plugin: 'io.realm.kotlin'
apply plugin: 'realm-android'

android {
    //色々
}

dependencies {
    //色々
}

初心者すぎて過不足ありまくりだと思うのでご了承ください。
要は、Projectのbuildgradleにbuildscript{}を自分で追加しなければいけないということが分からなかった。
これが無かったからapply plugin: 'realm-android'を書くとビルドエラーになったんだと思う。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?