Android应用程序不会启动(使用Eclipse) [英] Android app won't launch (using Eclipse)

查看:185
本文介绍了Android应用程序不会启动(使用Eclipse)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个Android应用程序的第一次合作。它不发射和,因为这是我的第一个应用程序,我不明白的错误。这里是控制台输出:

  [2014年7月4日九时12分09秒 -  LeapMotionApp]在设备上启动活动com.example.leapmotionapp.MainActivity模拟器-5554
[2014年7月4日9时12分12秒 - LeapMotionApp]安装由于无效的URI失败!
[2014年7月4日9时12分12秒 - LeapMotionApp]请检查logcat的输出获取更多信息。
[2014年7月4日9时12分12秒 - LeapMotionApp]启动取消!
[2014年7月4日9时12分12秒 - LeapMotionApp] ActivityManager:开始:意向{行动= android.intent.action.MAIN猫= [android.intent.category.LAUNCHER] CMP = com.example.leapmotionapp / .MainActivity }

和这里是logcat的输出:

  07-04 13:12:12.930:E / AndroidRuntime(761):致命异常:主要
07-04 13:12:12.930:E / AndroidRuntime(761):工艺:com.example.leapmotionapp,PID:761
07-04 13:12:12.930:E / AndroidRuntime(761):了java.lang.RuntimeException:无法启动活动ComponentInfo {com.example.leapmotionapp / com.example.leapmotionapp.MainActivity}:android.util.AndroidRuntimeException:您不能结合刷卡解雇和操作栏。
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.ActivityThread.access $ 800(ActivityThread.java:138)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1209)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.os.Handler.dispatchMessage(Handler.java:102)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.os.Looper.loop(Looper.java:136)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.ActivityThread.main(ActivityThread.java:5026)
07-04 13:12:12.930:E / AndroidRuntime(761):在java.lang.reflect.Method.invokeNative(本机方法)
07-04 13:12:12.930:E / AndroidRuntime(761):在java.lang.reflect.Method.invoke(Method.java:515)
07-04 13:12:12.930:E / AndroidRuntime(761):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:777)
07-04 13:12:12.930:E / AndroidRuntime(761):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
07-04 13:12:12.930:E / AndroidRuntime(761):在dalvik.system.NativeStart.main(本机方法)
07-04 13:12:12.930:E / AndroidRuntime(761):android.util.AndroidRuntimeException:产生的原因无法合并刷卡解雇和操作栏。
07-04 13:12:12.930:E / AndroidRuntime(761):在com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275)
07-04 13:12:12.930:E / AndroidRuntime(761):在com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872)
07-04 13:12:12.930:E / AndroidRuntime(761):在com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129)
07-04 13:12:12.930:E / AndroidRuntime(761):在com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.Activity.setContentView(Activity.java:1930)
07-04 13:12:12.930:E / AndroidRuntime(761):在com.example.leapmotionapp.MainActivity.onCreate(MainActivity.java:15)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.Activity.performCreate(Activity.java:5242)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-04 13:12:12.930:E / AndroidRuntime(761):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
07-04 13:12:12.930:E / AndroidRuntime(761):11 ...更多

任何帮助,将AP preciated。 <一href=\"http://stackoverflow.com/questions/24563783/android-app-wont-launch#comment38047110_24563783\">Here是code从一个问题我刚才问的.java和.xml文件

鸭preciate所有帮助

编辑:
这里是明显的:

 &LT;?XML版本=1.0编码=UTF-8&GT?;
&LT;清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=com.example.leapmotionapp
    安卓版code =1
    机器人:=的versionName1.0&GT;    &LT;用途-SDK
        安卓的minSdkVersion =8
        机器人:targetSdkVersion =21/&GT;    &lt;应用
        机器人:allowBackup =真
        机器人:图标=@绘制/ ic_launcher
        机器人:标签=@字符串/ APP_NAME
        机器人:主题=@风格/ AppTheme&GT;
        &LT;活动
            机器人:名字=。MainActivity
            机器人:标签=@字符串/ APP_NAME&GT;
            &所述;意图滤光器&gt;
                &lt;作用机器人:名字=android.intent.action.MAIN/&GT;                &LT;类机器人:名字=android.intent.category.LAUNCHER/&GT;
            &所述; /意图滤光器&gt;
        &LT; /活性GT;
    &LT; /用途&gt;&LT; /清单&GT;


解决方案

您的情况下,有这样的错误:

android.util.AndroidRuntimeException:你不能组合刷卡解雇和操作栏

更改目标版本:

安卓targetSdkVersion =21

TO:

安卓targetSdkVersion =19

在这里看到

targetSdkVersion设置

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>

解决方案

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

这篇关于Android应用程序不会启动(使用Eclipse)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆