Android - 解析失败:cardview-v7
Android - Failed to resolve: cardview-v7
我的 gradle
如下所示:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.11.2'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
//apply plugin: 'com.google.firebase.firebase-crash'
repositories {
jcenter()
}
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "qq.qq.qq"
manifestPlaceholders = [onesignal_app_id : "11-0a8b-1-1-11",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "1111"]
minSdkVersion 16
targetSdkVersion 27
versionCode 13
versionName "2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
dataBinding {
enabled = true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
minifyEnabled false
//shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix '.debug'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
//implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.netflix.rxjava:rxjava-android:0.20.3'
implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-material:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-material-community:2.2.2'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.onesignal:OneSignal:[3.10.1, 3.99.99]'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
testImplementation 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.android.support:support-compat:27.1.1'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
implementation 'com.android.support:multidex:1.0.3'
implementation 'org.jsoup:jsoup:1.10.1'
//DNS
implementation 'org.pcap4j:pcap4j-core:1.7.3'
implementation 'org.pcap4j:pcap4j-packetfactory-static:1.7.3'
implementation 'org.minidns:minidns-client:0.3.0'
}
apply plugin: 'com.google.gms.google-services'
并且:
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.1.0'
classpath 'io.fabric.tools:gradle:1.25.4'
classpath ('com.google.firebase:firebase-plugins:1.1.5') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com'
}
maven { url "https://storage.googleapis.com/snap-kit-build/maven" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
但是让我报错:
Failed to resolve: cardview-v7
当我使用来自 ./gradlew dependencies
的消息时:
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
这是我的 manifest
:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ww.ww.ww">
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!--ByPass-->
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/logo_squre"
android:label="@string/app_name"
android:roundIcon="@mipmap/logo_round"
android:supportsRtl="false"
android:theme="@style/AppTheme">
<meta-data
android:name="asset_statements"
android:resource="@string/asset_statements" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<meta-data
android:name="com.onesignal.NotificationOpened.DEFAULT"
android:value="DISABLE" />
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<provider
android:name="w.w.w.tools.GenericFileProvider"
android:authorities="${applicationId}.openpdf"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths_external" />
</provider>
<activity
android:name=".start.StartActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".main.MainActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|uiMode|orientation|screenSize|smallestScreenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity
android:name=".listfieldsdegree.ListFieldsDegreeActivity"
android:screenOrientation="portrait" />
<activity
android:name=".contentlistfieldsdegree.ContentListFieldDegreeWebViewActivity"
android:screenOrientation="portrait" />
<service android:name=".downloader.DownloadService" />
<service android:name=".downloaderkayako.DownloadServiceKayako" />
<activity
android:name=".shorttermcourses.ShortTermCoursesActivity"
android:screenOrientation="portrait" />
<activity
android:name=".aboutus.AboutUsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ww.ShortTermCourseSelectedActivity"
android:screenOrientation="portrait" />
<service
android:name=".fragments.ww.ww.GetContactListLocaleService"
android:process=":GetContactListLocaleService" />
<!--region ByPass-->
<service
android:name=".bypass.service.DaedalusVpnService"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>
<service
android:name=".ww.service.DaedalusTileService"
android:icon="@drawable/ic_security"
android:label="@string/app_name"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<receiver android:name=".ww.receiver.BootBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</receiver>
<receiver
android:name=".ww.receiver.StatusBarBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="ww.ww.ww.bypass.ww.StatusBarBroadcastReceiver.STATUS_BAR_BTN_DEACTIVATE_CLICK_ACTION" />
<action android:name="ww.ww.ww.bypass.receiver.StatusBarBroadcastReceiver.STATUS_BAR_BTN_SETTINGS_CLICK_ACTION" />
</intent-filter>
</receiver>
<activity
android:name=".ww.ww.StartByPassActivity"
android:screenOrientation="portrait" />
<!--endregion-->
</application>
</manifest>
我能做什么?
我将其更改为喜欢以下内容和出色的工作:
compileSdkVersion 28
targetSdkVersion 28
并且:
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
implementation 'com.android.support:exifinterface:28.0.0-rc01'
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:recyclerview-v7:28.0.0-rc01'
implementation 'com.android.support:cardview-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc01'
implementation 'com.android.support:multidex:1.0.3'
我的 gradle
如下所示:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.11.2'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
//apply plugin: 'com.google.firebase.firebase-crash'
repositories {
jcenter()
}
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "qq.qq.qq"
manifestPlaceholders = [onesignal_app_id : "11-0a8b-1-1-11",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "1111"]
minSdkVersion 16
targetSdkVersion 27
versionCode 13
versionName "2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
dataBinding {
enabled = true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
minifyEnabled false
//shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix '.debug'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
//implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.netflix.rxjava:rxjava-android:0.20.3'
implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-material:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-material-community:2.2.2'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.onesignal:OneSignal:[3.10.1, 3.99.99]'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
testImplementation 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.android.support:support-compat:27.1.1'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
implementation 'com.android.support:multidex:1.0.3'
implementation 'org.jsoup:jsoup:1.10.1'
//DNS
implementation 'org.pcap4j:pcap4j-core:1.7.3'
implementation 'org.pcap4j:pcap4j-packetfactory-static:1.7.3'
implementation 'org.minidns:minidns-client:0.3.0'
}
apply plugin: 'com.google.gms.google-services'
并且:
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.1.0'
classpath 'io.fabric.tools:gradle:1.25.4'
classpath ('com.google.firebase:firebase-plugins:1.1.5') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com'
}
maven { url "https://storage.googleapis.com/snap-kit-build/maven" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
但是让我报错:
Failed to resolve: cardview-v7
当我使用来自 ./gradlew dependencies
的消息时:
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
这是我的 manifest
:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ww.ww.ww">
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!--ByPass-->
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/logo_squre"
android:label="@string/app_name"
android:roundIcon="@mipmap/logo_round"
android:supportsRtl="false"
android:theme="@style/AppTheme">
<meta-data
android:name="asset_statements"
android:resource="@string/asset_statements" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<meta-data
android:name="com.onesignal.NotificationOpened.DEFAULT"
android:value="DISABLE" />
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<provider
android:name="w.w.w.tools.GenericFileProvider"
android:authorities="${applicationId}.openpdf"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths_external" />
</provider>
<activity
android:name=".start.StartActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".main.MainActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|uiMode|orientation|screenSize|smallestScreenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity
android:name=".listfieldsdegree.ListFieldsDegreeActivity"
android:screenOrientation="portrait" />
<activity
android:name=".contentlistfieldsdegree.ContentListFieldDegreeWebViewActivity"
android:screenOrientation="portrait" />
<service android:name=".downloader.DownloadService" />
<service android:name=".downloaderkayako.DownloadServiceKayako" />
<activity
android:name=".shorttermcourses.ShortTermCoursesActivity"
android:screenOrientation="portrait" />
<activity
android:name=".aboutus.AboutUsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ww.ShortTermCourseSelectedActivity"
android:screenOrientation="portrait" />
<service
android:name=".fragments.ww.ww.GetContactListLocaleService"
android:process=":GetContactListLocaleService" />
<!--region ByPass-->
<service
android:name=".bypass.service.DaedalusVpnService"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>
<service
android:name=".ww.service.DaedalusTileService"
android:icon="@drawable/ic_security"
android:label="@string/app_name"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<receiver android:name=".ww.receiver.BootBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</receiver>
<receiver
android:name=".ww.receiver.StatusBarBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="ww.ww.ww.bypass.ww.StatusBarBroadcastReceiver.STATUS_BAR_BTN_DEACTIVATE_CLICK_ACTION" />
<action android:name="ww.ww.ww.bypass.receiver.StatusBarBroadcastReceiver.STATUS_BAR_BTN_SETTINGS_CLICK_ACTION" />
</intent-filter>
</receiver>
<activity
android:name=".ww.ww.StartByPassActivity"
android:screenOrientation="portrait" />
<!--endregion-->
</application>
</manifest>
我能做什么?
我将其更改为喜欢以下内容和出色的工作:
compileSdkVersion 28
targetSdkVersion 28
并且:
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
implementation 'com.android.support:exifinterface:28.0.0-rc01'
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:recyclerview-v7:28.0.0-rc01'
implementation 'com.android.support:cardview-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc01'
implementation 'com.android.support:multidex:1.0.3'