不幸的是(应用程序名称)已经停止 [英] Unfortunately (app name) has stopped

查看:148
本文介绍了不幸的是(应用程序名称)已经停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是全新到Android。我有code极其有限的知识。当我尝试我的Andr​​oid设备上运行应用程序,它涉及了不幸的是(应用程序名称)已停止可以请一些身体告诉我如何解决这个消息

这是我的清单

 <?XML版本=1.0编码=UTF-8&GT?;
<清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
  包=com.benchaful.newboard
  安卓版code =1
  机器人:=的versionName1.0>
<应用机器人:图标=@绘制/图标机器人:标签=@字符串/ APP_NAME>
    <活动机器人:名字=com.benchaful.newBoard
              机器人:标签=@字符串/ APP_NAME
              机器人:screenOrientation =肖像>
        &所述;意图滤光器>
            <作用机器人:名字=android.intent.action.MAIN/>
            <类机器人:名字=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
    < /活性GT;
        <活动机器人:名字=com.google.ads.AdActivity
          机器人:configChanges =键盘| keyboardHidden |方向/>
< /用途>
    <使用许可权的android:NAME =android.permission.INTERNET对/>
    <使用许可权的android:NAME =android.permission.ACCESS_NETWORK_STATE/>< /清单>

我主要布局

 <?XML版本=1.0编码=UTF-8&GT?;<的RelativeLayout的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
的xmlns:广告=htt​​p://schemas.android.com/apk/res/com.benchaful.newboard
    机器人:方向=垂直
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    >    <滚动型的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:ID =@ + ID / scrollview1
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    >        <的LinearLayout的android:layout_width =FILL_PARENT
         机器人:ID =@ + ID / home_layout
         机器人:方向=垂直
         机器人:layout_height =WRAP_CONTENT
         机器人:背景=#000000
         >

有一些按钮位置

 <的WebView
    机器人:ID =@ + ID / ACCESSKEY
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =100px的
/>
    < / LinearLayout中>
< /滚动型>< LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
              的xmlns:广告=htt​​p://schemas.android.com/apk/res/com.benchaful.newboard
              机器人:方向=垂直
              机器人:layout_width =FILL_PARENT
              机器人:layout_height =WRAP_CONTENT
              机器人:背景=#FFFFFF
              机器人:重力=底
              机器人:layout_alignParentBottom =真
              机器人:layout_alignBottom =@ + ID / home_layout
              >

这是我的logcat

  16 06-05:32:04.423:E / AndroidRuntime(9665):致命异常:主要
06-05 16:32:04.423:E / AndroidRuntime(9665):了java.lang.RuntimeException:无法实例活动ComponentInfo {com.benchaful.newboard / com.benchaful.newBoard}:抛出java.lang.ClassNotFoundException:com.benchaful .newBoard
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2045)
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2146)
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.app.ActivityThread.access $ 700(ActivityThread.java:140)
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1238)
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.os.Handler.dispatchMessage(Handler.java:99)
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.os.Looper.loop(Looper.java:137)
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.app.ActivityThread.main(ActivityThread.java:4944)
06-05 16:32:04.423:E / AndroidRuntime(9665):在java.lang.reflect.Method.invokeNative(本机方法)
06-05 16:32:04.423:E / AndroidRuntime(9665):在java.lang.reflect.Method.invoke(Method.java:511)
06-05 16:32:04.423:E / AndroidRuntime(9665):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1038)
06-05 16:32:04.423:E / AndroidRuntime(9665):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
06-05 16:32:04.423:E / AndroidRuntime(9665):在dalvik.system.NativeStart.main(本机方法)
06-05 16:32:04.423:E / AndroidRuntime(9665):抛出java.lang.ClassNotFoundException:产生的原因com.benchaful.newBoard
06-05 16:32:04.423:E / AndroidRuntime(9665):在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-05 16:32:04.423:E / AndroidRuntime(9665):在java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-05 16:32:04.423:E / AndroidRuntime(9665):在java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.app.Instrumentation.newActivity(Instrumentation.java:1068)
06-05 16:32:04.423:E / AndroidRuntime(9665):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2036)
06-05 16:32:04.423:E / AndroidRuntime(9665):11 ...更多


解决方案

你是什么活动的全名?你的表现有这样的:

<活动机器人:名字=com.benchaful.newBoard...>

但com.benchaful.newBoard是你的包名。

I am totally new to android. I have an extremely limited knowledge of code. When I attempt to run the application on my android device it comes up with the message "unfortunately (app name) has stopped" please can some body inform me on how to fix this

This is my manifest

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


<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name="com.benchaful.newBoard"
              android:label="@string/app_name"
              android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
        <activity android:name="com.google.ads.AdActivity" 
          android:configChanges="keyboard|keyboardHidden|orientation" />
</application>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

</manifest>

My main layout

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/com.benchaful.newboard"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollview1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

        <LinearLayout android:layout_width="fill_parent"
         android:id="@+id/home_layout"
         android:orientation="vertical"
         android:layout_height="wrap_content"
         android:background="#000000"
         >

There are some buttons here

<WebView 
    android:id="@+id/accesskey"
    android:layout_width="fill_parent"
    android:layout_height="100px"
/>


    </LinearLayout>
</ScrollView>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:ads="http://schemas.android.com/apk/res/com.benchaful.newboard"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="#ffffff"
              android:gravity="bottom"
              android:layout_alignParentBottom="true"
              android:layout_alignBottom="@+id/home_layout"
              >

And this is my logcat

06-05 16:32:04.423: E/AndroidRuntime(9665): FATAL EXCEPTION: main
06-05 16:32:04.423: E/AndroidRuntime(9665): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.benchaful.newboard/com.benchaful.newBoard}: java.lang.ClassNotFoundException: com.benchaful.newBoard
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2045)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2146)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.app.ActivityThread.access$700(ActivityThread.java:140)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.os.Looper.loop(Looper.java:137)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.app.ActivityThread.main(ActivityThread.java:4944)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at java.lang.reflect.Method.invokeNative(Native Method)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at java.lang.reflect.Method.invoke(Method.java:511)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at dalvik.system.NativeStart.main(Native Method)
06-05 16:32:04.423: E/AndroidRuntime(9665): Caused by: java.lang.ClassNotFoundException: com.benchaful.newBoard
06-05 16:32:04.423: E/AndroidRuntime(9665):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
06-05 16:32:04.423: E/AndroidRuntime(9665):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2036)
06-05 16:32:04.423: E/AndroidRuntime(9665):     ... 11 more

解决方案

What is the full name of your Activity? Your manifest has this:

<activity android:name="com.benchaful.newBoard" ... >

but "com.benchaful.newBoard" is your package name.

这篇关于不幸的是(应用程序名称)已经停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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