我开发了一个Android应用程序(API 23),但它不起作用。我发现了这个错误:
E:\AllInOne1\app\src\main\java\eniso\ia32\Rabie\allinone\spinnerActivity.java
Error:(3, 42)
error: package android.support.v7.internal.widget does not exist
Error:(4, 60) error: package android.support.v7.internal.widget.AdapterViewCompat does not exist
Error:(8, 65) error: cannot find symbol class OnItemSelectedListener
Error:(23, 30) error: cannot find symbol class AdapterViewCompat
Error:(30, 33) error: cannot find symbol class AdapterViewCompat
Error:(22, 3) error: method does not override or implement a method from a supertype
Error:(29, 3) error: method does not override or implement a method from a supertype
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:23'
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "eniso.ia32.Rabie.allinone"
minSdkVersion 11
targetSdkVersion 21
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_5
targetCompatibility JavaVersion.VERSION_1_5
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
}
我已安装" android支持库"但它不起作用
snipperActivity.java :
package eniso.ia32.Rabie.allinone;
import android.support.v7.internal.widget.AdapterViewCompat;
import android.support.v7.internal.widget.AdapterViewCompat.OnItemSelectedListener;
import android.view.View;
import android.widget.AdapterView;
public class spinnerActivity extends TourismActivity implements OnItemSelectedListener {
public void onItemSelected(AdapterView<?> parent, View view,
int pos, long id) {
// An item was selected. You can retrieve the selected item using
// parent.getItemAtPosition(pos)
}
public void onNothingSelected(AdapterView<?> parent) {
// Another interface callback
}
@Override
public void onItemSelected(AdapterViewCompat<?> arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
}
@Override
public void onNothingSelected(AdapterViewCompat<?> arg0) {
// TODO Auto-generated method stub
}
}