我正在尝试将firebase云存储添加到我的应用程序中.下面是app build.gradle.但它说:无法解决:com.google.firebase:firebase-core:16.0.1.为什么?依赖项中根本没有firebase-core.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.louise.udacity.mydict"
minSdkVersion 15
targetSdkVersion 27
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(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.cloud:google-cloud-storage:1.31.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud) 我将Android Studio更新到最后一个版本(3.1 Canary 8)并强制将com.android.tools.build:gradle更新到版本3.1.0-alpha08,但同步项目我收到此错误:
Could not find sdk-common.jar (com.android.tools:sdk-common:26.1.0-alpha08).
Searched in the following locations:
https://maven.google.com/com/android/tools/sdk-common/26.1.0-alpha08/sdk-common-26.1.0-alpha08.jar
Run Code Online (Sandbox Code Playgroud)
我四处搜索但未找到解决方案,有人可以帮我解决这个问题吗?
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0-alpha07'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.2'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
非常感谢提前.
更新:这是新的bukd.gradle(项目):
buildscript { …Run Code Online (Sandbox Code Playgroud) android android-studio build.gradle android-gradle-plugin android-studio-3.1