2017-01-06 75 views
0

AndroidStudio 2.2.3がRealmRecyclerViewAdapterリファレンスを解決できません。私は、RealmサイトのRecyclerViewAdaperの例をそのまま続けました。 RealmRecyclerViewAdapterが見つからない理由を誰かが助けてくれますか?ここでAndroidStudioがRealmRecyclerViewAdapterを見つけられない - android realm-plugin:2.2.2

は私のimport文です:

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.3' 
     classpath 'io.realm:realm-gradle-plugin:2.2.2' 

     // 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 
} 

ここに私のアプリケーションレベルのGradleファイルがあります:

import io.realm.OrderedRealmCollection; 
import io.realm.RealmRecyclerViewAdapter; //this fails 

ここに私のプロジェクトレベルのGradleファイルです

は、プラグインを適用する:「COMを。 android.application ' apply plugin:' realm-android '

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.creditcardcalcx" 
     minSdkVersion 23 
     targetSdkVersion 25 
     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(dir: 'libs', include: ['*.jar']) 
    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:25.1.0' 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' 
    compile 'com.android.support:recyclerview-v7:25.1.0' 
    compile 'com.android.support:design:25.1.0' 
} 

答えて

1

うん、あなたは次の依存関係が欠落している

dependencies { 
    compile 'io.realm:android-adapters:1.4.0' 
} 
+0

素晴らしい、それは働きました!私は欠けていた依存があったと思ったが、私は彼らのイントロのドキュメンテーションで何も見ていなかった。これらの追加の依存関係がドキュメントのどこにでも出てくるかどうか知っていますか? – ambr8978

+0

https://realm.io/docs/java/latest/#adapters – EpicPandaForce

+0

(明らかに彼らは[realm android user store]を持っていませんが(https://github.com/realm/realm-android-user-店舗)どこでも言及したので、私は文書が完全ではないと思う) – EpicPandaForce

関連する問題