Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
146 views
in Technique[技术] by (71.8m points)

java - Android app won't launch (using Eclipse)

Working on an Android app for the first time. It is not launching and because it's my first app, I don't understand the errors. Here is the console output:

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

and Here is the logcat output:

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

any help, would be appreciated. Here is the code for the .java and .xml files from a question I asked earlier

Appreciate all help

EDIT: Here is the manifest:

<?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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your case, have this error:

android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.

Change target Version:

android:targetSdkVersion="21"

TO:

android:targetSdkVersion="19"

See here

targetSdkVersion setting


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...