Android应用程序将无法启动 [英] Android App won't launch

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

问题描述

我做在Eclipse中的Andr​​oid应用程序,这是下面的错误我得到当我运行应用程序:

  [2014年7月3日17时39分三十秒 -  LeapMotionApp] ActivityManager:开始:意向{行动= android.intent.action.MAIN猫= [android.intent.category。 LAUNCHER] CMP = com.example.leapmotionapp / .MainActivity}

下面是MainActivity.java code:

 包com.example.leapmotionapp;进口android.app.Activity;
进口android.os.Bundle;
进口android.view.Menu;
进口android.view.MenuItem;
导入com.leapmotion.leap *。
进口com.leapmotion.leap.Gesture.State;公共类MainActivity延伸活动{    @覆盖
    保护无效的onCreate(捆绑savedInstanceState){
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.activity_main);
        的System.out.println(上马);
    }
}

下面是activity_main.xml中code:

 <的RelativeLayout的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    的xmlns:工具=htt​​p://schemas.android.com/tool​​s
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent
    工具:上下文=MainActivity。>    <的TextView
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:文字=@字符串/参考hello world/>< / RelativeLayout的>

只是一个小的背景,这是我在做一个Android应用程序第一次去,和App的目的是当一切都说过和做过的大跃进运动传感器进行通信。让我知道如果您有任何问题,任何建议将是AP preciated。

编辑:
现在,让这些错误:

  [2014年7月3日18时05分02秒 -  LeapMotionApp] ActivityManager:开始:意向{行动= android.intent.action.MAIN猫= [android.intent.category。 LAUNCHER] CMP = com.example.leapmotionapp / .MainActivity}
[2014年7月3日18时05分02秒 - LeapMotionApp] ActivityManager:警告:活动尚未开始,目前的任务已被带到前面

下面是清单还:

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


解决方案

删除此部分:

 <活动
        机器人:名字=com.example.leapmotionapp.MainActivity
        机器人:标签=@字符串/ APP_NAME>
< /活性GT;

这是正确的:

 <的RelativeLayout的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    的xmlns:工具=htt​​p://schemas.android.com/tool​​s
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent
    工具:上下文=MainActivity。>    <的TextView
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:文字=@字符串/参考hello world/>< / RelativeLayout的>

我回答说,在<一个href=\"http://stackoverflow.com/questions/24575308/android-app-wont-launch-using-eclipse/24575448#24575448\">this问题

看看这会帮助你。

I'm making an android app in eclipse, and this is the following error I'm getting when I run the app:

[2014-07-03 17:39:30 - LeapMotionApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.leapmotionapp/.MainActivity }

Here is the MainActivity.java code:

package com.example.leapmotionapp;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.leapmotion.leap.*;
import com.leapmotion.leap.Gesture.State;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        System.out.println("launched");
    }
}

Here is the activity_main.xml code:

<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"
    tools:context=".MainActivity" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

</RelativeLayout>

Just for a little background, this is my first go at making an Android app, and the App is intended to communicate with the Leap Motion sensor when all is said and done. Let me know if you have any questions, and any suggestions would be appreciated.

EDIT: Now getting these errors:

[2014-07-03 18:05:02 - LeapMotionApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.leapmotionapp/.MainActivity }
[2014-07-03 18:05:02 - LeapMotionApp] ActivityManager: Warning: Activity not started, its current task has been brought to the front

Here is the manifest also:

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

解决方案

Remove this part:

<activity
        android:name="com.example.leapmotionapp.MainActivity"
        android:label="@string/app_name" >
</activity> 

Here is correct:

<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"
    tools:context=".MainActivity" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

</RelativeLayout>

I replied that on this issue

See if this will help you.

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

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