无法将 EmojiCompat 库 (com.android.support:support-emoji:26.1.0) 添加到我的应用 gradle
Not able to add EmojiCompat library(com.android.support:support-emoji:26.1.0) to my app gradle
我想在我的 Android 应用程序中使用 EmojiCompat 支持库。当我添加 -com.android.support:support-emoji:26.1.0 - 作为应用程序模块 gradle 中的依赖项并尝试同步它时,出现以下错误 -
Error:(31, 13) Failed to resolve: com.android.support:support-emoji:26.1.0
下面是我的build.gradle(项目模块)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// 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.script(应用程序模块)下方 -
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "example.example.com.emojis2"
minSdkVersion 19
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 {
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:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
//adding lib
compile 'com.android.support:support-emoji:26.1.0'
}
我缺少什么,有人可以帮忙吗!提前致谢...
Error:(31, 13) Failed to resolve:
com.android.support:support-emoji:26.1.0
您应该将其添加到您的 PROJECT LEVEL build.gradle
部分。
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
演示版
buildscript {
repositories {
jcenter()
// You need to add the following repository to download the new plugin.
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
仅供参考
要将它们添加到您的构建中,您需要首先在您的顶级 build.gradle
[=30 中包含 Google's Maven repository
=] 文件:
allprojects {
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must instead use:
// maven {
// url 'https://maven.google.com'
// }
// An alternative URL is 'https://dl.google.com/dl/android/maven2/'
}
}
我想在我的 Android 应用程序中使用 EmojiCompat 支持库。当我添加 -com.android.support:support-emoji:26.1.0 - 作为应用程序模块 gradle 中的依赖项并尝试同步它时,出现以下错误 -
Error:(31, 13) Failed to resolve: com.android.support:support-emoji:26.1.0
下面是我的build.gradle(项目模块)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// 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.script(应用程序模块)下方 -
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "example.example.com.emojis2"
minSdkVersion 19
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 {
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:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
//adding lib
compile 'com.android.support:support-emoji:26.1.0'
}
我缺少什么,有人可以帮忙吗!提前致谢...
Error:(31, 13) Failed to resolve: com.android.support:support-emoji:26.1.0
您应该将其添加到您的 PROJECT LEVEL build.gradle
部分。
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
演示版
buildscript {
repositories {
jcenter()
// You need to add the following repository to download the new plugin.
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
仅供参考
要将它们添加到您的构建中,您需要首先在您的顶级 build.gradle
[=30 中包含 Google's Maven repository
=] 文件:
allprojects {
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must instead use:
// maven {
// url 'https://maven.google.com'
// }
// An alternative URL is 'https://dl.google.com/dl/android/maven2/'
}
}