targetSdkVersion Einstellung
Wenn mir jemand helfen könnte mit diesem. Ich heruntergeladen habe, AndroidSDK und alles was sonst noch benötigt für android-Programmierung, und ich stellte mich vor einige Probleme (komisch zu sagen) Hallo Welt.
Ich bekomme einfach nicht die Sache mit tarketSdkVersion Einstellung im AppManifest. Wenn Sie nicht gesetzt ist "13" (ist gerade aufgefallen 8 das ist mein minSdkVersion funktioniert auch) - Anwendung hat die "Leider-Anwendung funktioniert nicht mehr" - Bildschirm mit dieser in LogCat:
07-01 01:26:47.820: E/AndroidRuntime(902): FATAL EXCEPTION: main
07-01 01:26:47.820: E/AndroidRuntime(902): Process: pl.bbZoftware.eclipsestandalone, PID: 902
07-01 01:26:47.820: E/AndroidRuntime(902): java.lang.RuntimeException: Unable to start activity ComponentInfo{pl.bbZoftware.eclipsestandalone/pl.bbZoftware.eclipsestandalone.MainActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.ActivityThread.access$800(ActivityThread.java:138)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.os.Handler.dispatchMessage(Handler.java:102)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.os.Looper.loop(Looper.java:136)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.ActivityThread.main(ActivityThread.java:5026)
07-01 01:26:47.820: E/AndroidRuntime(902): at java.lang.reflect.Method.invokeNative(Native Method)
07-01 01:26:47.820: E/AndroidRuntime(902): at java.lang.reflect.Method.invoke(Method.java:515)
07-01 01:26:47.820: E/AndroidRuntime(902): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
07-01 01:26:47.820: E/AndroidRuntime(902): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
07-01 01:26:47.820: E/AndroidRuntime(902): at dalvik.system.NativeStart.main(Native Method)
07-01 01:26:47.820: E/AndroidRuntime(902): Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
07-01 01:26:47.820: E/AndroidRuntime(902): at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275)
07-01 01:26:47.820: E/AndroidRuntime(902): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872)
07-01 01:26:47.820: E/AndroidRuntime(902): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129)
07-01 01:26:47.820: E/AndroidRuntime(902): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.Activity.setContentView(Activity.java:1930)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.support.v7.app.ActionBarActivity.superSetContentView(ActionBarActivity.java:217)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.support.v7.app.ActionBarActivityDelegateICS.setContentView(ActionBarActivityDelegateICS.java:110)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:77)
07-01 01:26:47.820: E/AndroidRuntime(902): at pl.bbZoftware.eclipsestandalone.MainActivity.onCreate(MainActivity.java:14)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.Activity.performCreate(Activity.java:5242)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-01 01:26:47.820: E/AndroidRuntime(902): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
07-01 01:26:47.820: E/AndroidRuntime(902): ... 11 more
07-01 01:26:55.340: I/Process(902): Sending signal. PID: 902 SIG: 9
Ich nicht bekommen, wenn dies beabsichtigt ist, bekam ich einige SDK-Fehler oder etwas anderes.
Ich war googeln für die Antworten, aber coulnt finden. Sagen Sie mir, wenn ich sollte hinzufügen, ein paar mehr Infos vom Projekt, der Suche nach Ihren Antworten.
EDIT: Vergaß hinzuzufügen, ich habe ein android-Gerät mit 4.4.2 KitKat, so dass ich wollte, um Projekt-Ziel auf 20 festgelegt. Das ist, wie ich bemerkte diesen Fehler.
EDIT2:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
activity_main.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="pl.bbZoftware.eclipsestandalone.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world" />
</RelativeLayout>
EDIT3:
manifest-Datei:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pl.bbZoftware.eclipsestandalone"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="13" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
- Poste bitte den code für
onCreate
für IhreMainActivity
Klasse. Auch nach der XML das layout, das Sie verwenden, wenn Sie anrufensetContentView
. Die wichtige information ist die Botschaft, die in der letzten "Verursacht durch" - Zeile in den stack-trace mit: "Sie können kombinieren wischen Entlassung und der action bar". - Ich bemerkte, dass diese Nachricht einfach nicht bekommen, was zu tun. Dies ist clean-Projekt, ich habe nichts verändert, außer targetSdkVersion.
- Vielleicht ist das problem nicht mit code, sondern mit dem AVD? Es gibt mein setup es: screenshot
- danke für die Hilfe, ich dachte mir es schon raus 🙂
Du musst angemeldet sein, um einen Kommentar abzugeben.
Ich nur gefunden, wo das problem war.
Nicht mit API-Level von 20 und Plattform 4.4 W, wie Android Virtual Device.
Mit Level 19 und Plattform 4.2.2 auf ADV alles läuft wie es soll.
Entfernen Sie einfach
android:targetSdkVersion
aus AndroidManifest.xmlMachen folgende änderungen:
Von
Zu:
Meisten wahrscheinlich, Sie machen Fehler auf activity_main.xml
Auch Ziel für 4.4.2 Kitkat ist 19. Haben Sie ein Häkchen in dieses android-api-levels-Seite.
Ändern
targetSdkVersion
im[project directory]\app\build.gradle
etwas kleiner als oder gleich 19. Ändern:Zu:
Android API 20 gibt Zusammenstellung Fragen. Stellen Sie sicher, dass die Verwendung der API 19 und legen Sie es als eine Gezielte SDK bei der Entwicklung.