报错内容如下,
Could not find com.android.support:appcompat-v7:28.0.0-beta01.
Searched in the following locations:
file:/D:/AndroidSDK/extras/m2repository/com/android/support/appcompat-v7/28.0.0-beta01/appcompat-v7-28.0.0-beta01.pom
file:/D:/AndroidSDK/extras/m2repository/com/android/support/appcompat-v7/28.0.0-beta01/appcompat-v7-28.0.0-beta01.jar
file:/D:/AndroidSDK/extras/google/m2repository/com/android/support/appcompat-v7/28.0.0-beta01/appcompat-v7-28.0.0-beta01.pom
file:/D:/AndroidSDK/extras/google/m2repository/com/android/support/appcompat-v7/28.0.0-beta01/appcompat-v7-28.0.0-beta01.jar
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/28.0.0-beta01/appcompat-v7-28.0.0-beta01.pom
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/28.0.0-beta01/appcompat-v7-28.0.0-beta01.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/28.0.0-beta01/appcompat-v7-28.0.0-beta01.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/28.0.0-beta01/appcompat-v7-28.0.0-beta01.jar
Required by:
project :app
Please install the Android Support Repository from the Android SDK Manager.
Open Android SDK Manager
首先想到的是换版本,在app->build.gradle中进行各种尝试,如
implementation 'com.android.support:appcompat-v7:27.1.1'
都不成功,最后把原来的项目拉出来,发现新项目project->build.gradle的repositories中都有google(),于是加上,问题解决。与app->build.gradle无关。
注意看全文,其中有两处必须都有google(),如下
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
java 语言能兼容识别大小写下的括号吗
02_Java基本语法关键字和保留字关键字(keyword)的定义和特点
定义:被Java语言赋予了特殊含义,用做专门用途的字符串(单词)特点:关键字中所有字母都为小写官方地址: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html保留字(reserved word)
Java保留字:现有Jav
Application设置全局变量以及传值 1. /**
2. * 重写Application,主要重写里面的onCreate方法,就是创建的时候,
3. * 我们让它初始化一些值,前段时间在javaeye里面看到过一个例子,与此相似,
4. * 我做了些改进。听说外国开发者习惯用此初始化一些全局变量,好像在Activity
5. * 一些类里面初始化全局变量的化,会遇到一些空指针的异常