因此,我已将Android Studio从1.5版更新至2.2.3,这完全破坏了我的项目。我在编程方面很新,而且我的应用程序之前工作得很好,但现在,每个Android库导入都标记为红色。Android Studio更新(1.5至2.2.3)中断项目
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.os.CountDownTimer;
例如,这些都不再被识别。我已经更新了Android Studio需要的所有内容,但是我不知道如何解决这个问题。
我gradle这个文件看起来像如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.privatpc.quiztest"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
}
的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// 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
}
更新: 做文件 - > “的Invalidate缓存/重新启动” 似乎工作。现在,下一个问题如下:
一旦我尝试运行该项目的应用程序打开并立即崩溃。我得到以下日志:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
你尝试清洗项目定位到所有的应用程序会崩溃? – Carcigenicate
是的,但没有变化。文件 - >“无效缓存/重启”似乎工作,因为没有更多的错误现在运行之前。 –