尝试很长时间但无法解决它。我也安装了android构建工具和支持库
的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.example.amrit.myapplication"
minSdkVersion 8
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFile 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
}
的.java
package com.example.amrit.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class Game extends ActionBarActivity {
答案 0 :(得分:9)
ActionBarActivity
已弃用很长时间了。您的import语句建议改为使用AppCompatActivity
:
public class Game extends AppCompatActivity {