我正在写一个来自Github的简单应用程序来学习如何使用recyclerview。但是在编写了以下代码之后我得到了" package recyclerview不存在"错误。
这是app.build.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.mmalishant.mezo"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
implementation 'com.android.support:recyclerview-v7:26.0.0'
compile 'com.android.support:appcompat-v7:26.0.0'
}
我得到这些错误
12-25 09:53:26.484 11514-11514/? E/PrefServiceImpl: Primary account is null
12-25 09:53:27.606 2447-2549/? E/Volley: [136] c.a: Unexpected response code 400 for https://android.clients.google.com/fdfe/selfUpdate?ex=1
12-25 09:53:28.019 2447-2447/? E/Finsky: [2] com.google.android.finsky.wear.bl.a(3): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
12-25 09:53:39.577 1547-1560/? E/memtrack: Couldn't load memtrack module
12-25 09:53:56.176 1547-1566/? E/NetdConnector: NDC event {613 IfaceClass active 0 17396635084990 0} took too long: 1009ms
12-25 09:53:59.205 1398-1398/? E/lowmemorykiller: Error writing /proc/7620/oom_score_adj; errno=22
12-25 09:54:05.194 1547-1564/? E/BatteryExternalStatsWorker: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
12-25 10:00:10.750 2498-2512/? E/ReloadingLock: Finalizing LOCKED Token[searchresults_activity 2017-12-23 18:39:37.899]
12-25 10:00:10.751 2498-2512/? E/ReloadingLock: Finalizing LOCKED Token[canvas 2017-12-23 18:39:37.912]
12-25 10:00:10.751 2498-2512/? E/ReloadingLock: Finalizing LOCKED Token[shortcuts 2017-12-23 18:39:38.085]
答案 0 :(得分:0)
替换
implementation 'com.klinkerapps:recyclerview:21.0.0'
带
implementation 'com.android.support:recyclerview-v7:26.0.0'