Android应用无法启动(使用Eclipse)

时间:2014-07-04 13:20:16

标签: java android eclipse

首次使用Android应用。它没有启动,因为它是我的第一个应用程序,我不明白错误。这是控制台输出:

[2014-07-04 09:12:09 - LeapMotionApp] Starting activity com.example.leapmotionapp.MainActivity on device emulator-5554
[2014-07-04 09:12:12 - LeapMotionApp] Installation failed due to invalid URI!
[2014-07-04 09:12:12 - LeapMotionApp] Please check logcat output for more details.
[2014-07-04 09:12:12 - LeapMotionApp] Launch canceled!
[2014-07-04 09:12:12 - LeapMotionApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.leapmotionapp/.MainActivity }

以下是logcat输出:

07-04 13:12:12.930: E/AndroidRuntime(761): FATAL EXCEPTION: main
07-04 13:12:12.930: E/AndroidRuntime(761): Process: com.example.leapmotionapp, PID: 761
07-04 13:12:12.930: E/AndroidRuntime(761): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.leapmotionapp/com.example.leapmotionapp.MainActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.ActivityThread.access$800(ActivityThread.java:138)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.os.Handler.dispatchMessage(Handler.java:102)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.os.Looper.loop(Looper.java:136)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.ActivityThread.main(ActivityThread.java:5026)
07-04 13:12:12.930: E/AndroidRuntime(761):  at java.lang.reflect.Method.invokeNative(Native Method)
07-04 13:12:12.930: E/AndroidRuntime(761):  at java.lang.reflect.Method.invoke(Method.java:515)
07-04 13:12:12.930: E/AndroidRuntime(761):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
07-04 13:12:12.930: E/AndroidRuntime(761):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
07-04 13:12:12.930: E/AndroidRuntime(761):  at dalvik.system.NativeStart.main(Native Method)
07-04 13:12:12.930: E/AndroidRuntime(761): Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
07-04 13:12:12.930: E/AndroidRuntime(761):  at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275)
07-04 13:12:12.930: E/AndroidRuntime(761):  at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872)
07-04 13:12:12.930: E/AndroidRuntime(761):  at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129)
07-04 13:12:12.930: E/AndroidRuntime(761):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.Activity.setContentView(Activity.java:1930)
07-04 13:12:12.930: E/AndroidRuntime(761):  at com.example.leapmotionapp.MainActivity.onCreate(MainActivity.java:15)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.Activity.performCreate(Activity.java:5242)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-04 13:12:12.930: E/AndroidRuntime(761):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
07-04 13:12:12.930: E/AndroidRuntime(761):  ... 11 more

任何帮助,将不胜感激。 Here is the code for the .java and .xml files from a question I asked earlier

感谢所有帮助

编辑: 这是清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.leapmotionapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />

    <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>

1 个答案:

答案 0 :(得分:-1)

你的情况,有这个错误:

android.util.AndroidRuntimeException:您无法将滑动解雇与操作栏结合使用。

更改目标版本:

机器人:targetSdkVersion =&#34; 21&#34;

TO:

机器人:targetSdkVersion =&#34; 19&#34;

见这里

targetSdkVersion setting