Android Studio2.2
realm-java-1.2.0
初心者です。
Realmの最新版は2.0.1らしいのですが公式でダウンロードボタンを押すと1.2.0の
ダウンロードが始まり、2.0.0のページでも同じことが起こったので、1.2.0を使っています。
Android StudioでRealmを用いてスケジュールアプリを作ろうとしています。
下に示すのはrealm-java-1.2.0の公式サイトです。
https://realm.io/docs/java/1.2.0/
質問は、公式サイトに書いてあることだけを行えば導入されたことになるのかということです。
ステップ1とステップ2に書いたことはやりましたが、これだけでいいのかと違和感を覚えます。
ダウンロードしたzipファイルはDownloadフォルダに入っていて、そこで解凍しただけです。
コーディングしたアプリをRunさせると
Error:Execution failed for task ':app:transformClassesWithRealmTransformerForDebug'. > javassist.NotFoundException: io.realm.ScheduleRealmProxyInterface
というエラーメッセージが出ます。
io.realm.ScheduleRealmProxyInterfaceがよくわからず困っています。
ScheduleはRealmObjectを継承したクラスです。
↓にプロジェクトルートのbuild.gradleと、appの下にあるbuild.gradleを載せます。
プロジェクトルートのbuild.gradle
/ Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' classpath "io.realm:realm-gradle-plugin:1.2.0" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
appの下にあるbuild.gradle
apply plugin: 'com.android.application' apply plugin: 'realm-android' android { compileSdkVersion 24 buildToolsVersion "24.0.2" defaultConfig { applicationId "com.example.tomotaro.myscheduler" minSdkVersion 15 targetSdkVersion 24 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:24.2.1' compile 'com.android.support:design:24.2.1' testCompile 'junit:junit:4.12' }