开发环境:
Android Studio 3.3.2
Build #AI-182.5107.16.33.5314842, built on February 16, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

运行环境:
Android SDK 28 (Android 9.0(Pie))
minSdkVersion 19
targetSdkVersion 28


Error: Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom'. Received status code 502 from server: Bad Gateway Enable Gradle 'offline mode' and sync project

解决方法:
build.gradle(Project:)中,

buildscript {    repositories {        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:3.3.2'    }}

jcenter()
改为:
jcenter { url 'https://maven.aliyun.com/repository/jcenter' }

buildscript {    repositories {        jcenter { url 'https://maven.aliyun.com/repository/jcenter' }    }    dependencies {        classpath 'com.android.tools.build:gradle:3.3.2'    }}

相当于把jcenter的远程仓库改为阿里云的仓库


ERROR: The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.Remove minSdkVersion and sync projectAffected Modules: appWARNING: The targetSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.Remove targetSdkVersion and sync projectAffected Modules: app

解决方法:
把AndroidManifest.xml文件里的这一段删除

 

之后在app/build.gradle(module:app)里指定minSdk和targetSdk;
compileSdk要改成实际编译运行时的版本

android {    compileSdkVersion 28    buildToolsVersion "28.0.3"    defaultConfig {        applicationId "com.example.zc_01"        minSdkVersion 19        targetSdkVersion 28    }

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.htmlAffected Modules: app

app/build.gradle(module:app)

dependencies {    compile 'com.android.support:appcompat-v7:18.0.0'    compile 'com.android.support:appcompat-v7:18.0.0'    compile 'com.android.support:support-v4:18.0.0'}

改为:

dependencies {    implementation fileTree(dir: 'libs', include: ['*.jar'])    implementation 'com.android.support:appcompat-v7:28.0.0'    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'}

错误: 找不到符号
符号: 类 ActionBarActivity
位置: 程序包 android.support.v7.app

这是因为ActionBarActivity 过时,
ActionBarctivity 已被它的父类AppCompatActivity替代了
所以 MainActivity 继承改为 AppCompatActivity 就可以

更多相关文章

  1. Android 发布项目到私服Nexus仓库
  2. 《阿里巴巴Android开发手册》正式发布,安卓开发者的福音
  3. 在android上使用ASCII显示特殊符号
  4. android 显示特殊符号
  5. 修改android studio 新建项目的build.gradle的仓库源
  6. Android开发人暗讽阿里:抄得不到位 不懂就要学
  7. 阿里ctf-2014 android 第三题――so动态调试及破解加固
  8. 阿里云物联网平,Android台接入问题(couldn't find "libcoap.so")

随机推荐

  1. Android获得电话本中的数据(ContentProvid
  2. android核心模块及相关技术
  3. 第二章 IPC机制
  4. Android(安卓)动态logo bootanimation.zi
  5. Binder驱动的实现
  6. C虾仔笔记 - EditText编辑框
  7. android 5.0系统 EditText控件
  8. android基本架构
  9. 基于蓝牙socket开发Android蓝牙通信
  10. Android实现全屏显示的方法