gpt4 book ai didi

android - 无法解析 : pub. devrel :easypermissions:0. 3.0

转载 作者:行者123 更新时间:2023-11-30 00:31:44 25 4
gpt4 key购买 nike

下面这段内容是我的android studio项目中的build.gradle。

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
}
}
apply plugin: 'com.android.application'

dependencies {
//classpath 'com.android.tools.build:gradle:2.4.0'

compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.google.android.gms:play-services:10.2.6'
compile 'com.android.support:appcompat-v7:25.2.0'
//compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.google.android.gms:play-services-auth:10.2.6'
compile 'pub.devrel:easypermissions:0.3.0'
compile('com.google.api-client:google-api-client-android:1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-script:v1-rev79-1.22.0') {
exclude group: 'org.apache.httpcomponents'
}

}

allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'

defaultConfig {
applicationId "com.example.quickstart"
minSdkVersion 11
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}

// compileOptions {
// sourceCompatibility JavaVersion.VERSION_1_8
// targetCompatibility JavaVersion.VERSION_1_8
// }

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')

// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

我想运行项目,它会显示下面的错误。然后我引用https://github.com/googlesamples/easypermissions,但我仍然不明白如何修复 Failed to resolve: pub.devrel:easypermissions:0.3.0 错误。

/Users/yayaigo/Downloads/SmsSourceCode/BroadcastReveiverNewSms/build.gradle
Error:Error:line (21)Failed to resolve: pub.devrel:easypermissions:0.3.0
<a href="openFile:/Users/yayaigo/Downloads/SmsSourceCode/BroadcastReveiverNewSms/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:Error:line (25)Failed to resolve: com.google.apis:google-api-services-script:v1-rev79-1.22.0
<a href="openFile:/Users/yayaigo/Downloads/SmsSourceCode/BroadcastReveiverNewSms/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:Error:line (22)Failed to resolve: com.google.api-client:google-api-client-android:1.22.0
<a href="openFile:/Users/yayaigo/Downloads/SmsSourceCode/BroadcastReveiverNewSms/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

下面是我的环境设置:

Android Studio version:2.3.2
Gradle:3.3

最佳答案

在您的 build.gradle 中添加 jcenter(),如下所示:

repositories {
mavenCentral()
jcenter()
}

关于android - 无法解析 : pub. devrel :easypermissions:0. 3.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44224335/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com