Как заставить приложение работать? Это показывает странную ошибку после запуска - PullRequest
0 голосов
/ 12 ноября 2011

Вот мой код, я пытаюсь запустить в Android. Он запускается, а затем выдает это странное сообщение об ошибке.

enter image description here

package com.example.neon;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloNeon extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        /* Create a TextView and set its content.
         * the text is retrieved by calling a native
         * function.
         */
        TextView  tv = new TextView(this);
        tv.setText( stringFromJNI() );
        setContentView(tv);
    }

    /* A native method that is implemented by the
     * 'helloneon' native library, which is packaged
     * with this application.
     */
    public native String  stringFromJNI();

    /* this is used to load the 'helloneon' library on application
     * startup. The library has already been unpacked into
     * /data/data/com.example.neon/lib/libhelloneon.so at
     * installation time by the package manager.
     */
    static {
        System.loadLibrary("helloneon");
    }
}

ОШИБКА:

[2011-11-12 16:41:13 - HelloJni] Unable to resolve target 'android-8'
[2011-11-12 16:42:37 - HelloJni] ------------------------------
[2011-11-12 16:42:37 - HelloJni] Android Launch!
[2011-11-12 16:42:37 - HelloJni] adb is running normally.
[2011-11-12 16:42:37 - HelloJni] Performing com.example.hellojni.HelloJni activity launch
[2011-11-12 16:42:37 - HelloJni] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:42:45 - HelloJni] Uploading HelloJni.apk onto device '33c20c143608197'
[2011-11-12 16:42:45 - HelloJni] Installing HelloJni.apk...
[2011-11-12 16:42:46 - HelloJni] Success!
[2011-11-12 16:42:46 - HelloJni] Starting activity com.example.hellojni.HelloJni on device 33c20c143608197
[2011-11-12 16:42:46 - HelloJni] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellojni/.HelloJni }
[2011-11-12 16:43:31 - HelloJni] ------------------------------
[2011-11-12 16:43:31 - HelloJni] Android Launch!
[2011-11-12 16:43:31 - HelloJni] adb is running normally.
[2011-11-12 16:43:31 - HelloJni] Performing com.example.hellojni.HelloJni activity launch
[2011-11-12 16:43:31 - HelloJni] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:43:37 - HelloJni] Application already deployed. No need to reinstall.
[2011-11-12 16:43:37 - HelloJni] Starting activity com.example.hellojni.HelloJni on device 33c20c143608197
[2011-11-12 16:43:38 - HelloJni] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellojni/.HelloJni }
[2011-11-12 16:44:18 - HelloJni] ------------------------------
[2011-11-12 16:44:18 - HelloJni] Android Launch!
[2011-11-12 16:44:18 - HelloJni] adb is running normally.
[2011-11-12 16:44:18 - HelloJni] Performing com.example.hellojni.HelloJni activity launch
[2011-11-12 16:44:18 - HelloJni] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:44:23 - HelloJni] Application already deployed. No need to reinstall.
[2011-11-12 16:44:23 - HelloJni] Starting activity com.example.hellojni.HelloJni on device 33c20c143608197
[2011-11-12 16:44:23 - HelloJni] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellojni/.HelloJni }
[2011-11-12 16:45:01 - HelloNeon] Unable to resolve target 'android-3'
[2011-11-12 16:45:15 - HelloJni] ------------------------------
[2011-11-12 16:45:15 - HelloJni] Android Launch!
[2011-11-12 16:45:15 - HelloJni] adb is running normally.
[2011-11-12 16:45:15 - HelloJni] Performing com.example.hellojni.HelloJni activity launch
[2011-11-12 16:45:15 - HelloJni] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:45:17 - HelloJni] Application already deployed. No need to reinstall.
[2011-11-12 16:45:17 - HelloJni] Starting activity com.example.hellojni.HelloJni on device 33c20c143608197
[2011-11-12 16:45:17 - HelloJni] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellojni/.HelloJni }
[2011-11-12 16:45:36 - HelloJni] ------------------------------
[2011-11-12 16:45:36 - HelloJni] Android Launch!
[2011-11-12 16:45:36 - HelloJni] adb is running normally.
[2011-11-12 16:45:36 - HelloJni] Performing com.example.hellojni.HelloJni activity launch
[2011-11-12 16:45:36 - HelloJni] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:45:40 - HelloJni] Application already deployed. No need to reinstall.
[2011-11-12 16:45:40 - HelloJni] Starting activity com.example.hellojni.HelloJni on device 33c20c143608197
[2011-11-12 16:45:40 - HelloJni] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellojni/.HelloJni }
[2011-11-12 16:45:55 - HelloJni] ------------------------------
[2011-11-12 16:45:55 - HelloJni] Android Launch!
[2011-11-12 16:45:55 - HelloJni] adb is running normally.
[2011-11-12 16:45:55 - HelloJni] Performing com.example.hellojni.HelloJni activity launch
[2011-11-12 16:45:55 - HelloJni] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:45:58 - HelloJni] Application already deployed. No need to reinstall.
[2011-11-12 16:45:58 - HelloJni] Starting activity com.example.hellojni.HelloJni on device 33c20c143608197
[2011-11-12 16:45:58 - HelloJni] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellojni/.HelloJni }
[2011-11-12 16:46:16 - HelloNeon] ------------------------------
[2011-11-12 16:46:16 - HelloNeon] Android Launch!
[2011-11-12 16:46:16 - HelloNeon] adb is running normally.
[2011-11-12 16:46:16 - HelloNeon] Performing com.example.neon.HelloNeon activity launch
[2011-11-12 16:46:16 - HelloNeon] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:46:21 - HelloNeon] WARNING: Application does not specify an API level requirement!
[2011-11-12 16:46:21 - HelloNeon] Device API version is 11 (Android 3.0.1)
[2011-11-12 16:46:21 - HelloNeon] Uploading HelloNeon.apk onto device '33c20c143608197'
[2011-11-12 16:46:21 - HelloNeon] Installing HelloNeon.apk...
[2011-11-12 16:46:23 - HelloNeon] Success!
[2011-11-12 16:46:23 - HelloNeon] Starting activity com.example.neon.HelloNeon on device 33c20c143608197
[2011-11-12 16:46:23 - HelloNeon] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.neon/.HelloNeon }
[2011-11-12 16:46:34 - HelloNeon] ------------------------------
[2011-11-12 16:46:34 - HelloNeon] Android Launch!
[2011-11-12 16:46:34 - HelloNeon] adb is running normally.
[2011-11-12 16:46:34 - HelloNeon] Performing com.example.neon.HelloNeon activity launch
[2011-11-12 16:46:34 - HelloNeon] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:46:36 - HelloNeon] WARNING: Application does not specify an API level requirement!
[2011-11-12 16:46:36 - HelloNeon] Device API version is 11 (Android 3.0.1)
[2011-11-12 16:46:37 - HelloNeon] Application already deployed. No need to reinstall.
[2011-11-12 16:46:37 - HelloNeon] Starting activity com.example.neon.HelloNeon on device 33c20c143608197
[2011-11-12 16:46:37 - HelloNeon] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.neon/.HelloNeon }
[2011-11-12 16:46:55 - HelloNeon] ------------------------------
[2011-11-12 16:46:55 - HelloNeon] Android Launch!
[2011-11-12 16:46:55 - HelloNeon] adb is running normally.
[2011-11-12 16:46:55 - HelloNeon] Performing com.example.neon.HelloNeon activity launch
[2011-11-12 16:46:55 - HelloNeon] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:46:57 - HelloNeon] WARNING: Application does not specify an API level requirement!
[2011-11-12 16:46:57 - HelloNeon] Device API version is 11 (Android 3.0.1)
[2011-11-12 16:46:58 - HelloNeon] Application already deployed. No need to reinstall.
[2011-11-12 16:46:58 - HelloNeon] Starting activity com.example.neon.HelloNeon on device 33c20c143608197
[2011-11-12 16:46:58 - HelloNeon] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.neon/.HelloNeon }
[2011-11-12 16:47:07 - HelloNeon] ------------------------------
[2011-11-12 16:47:07 - HelloNeon] Android Launch!
[2011-11-12 16:47:07 - HelloNeon] adb is running normally.
[2011-11-12 16:47:07 - HelloNeon] Performing com.example.neon.HelloNeon activity launch
[2011-11-12 16:47:07 - HelloNeon] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:47:10 - HelloNeon] WARNING: Application does not specify an API level requirement!
[2011-11-12 16:47:10 - HelloNeon] Device API version is 11 (Android 3.0.1)
[2011-11-12 16:47:10 - HelloNeon] Application already deployed. No need to reinstall.
[2011-11-12 16:47:10 - HelloNeon] Starting activity com.example.neon.HelloNeon on device 33c20c143608197
[2011-11-12 16:47:10 - HelloNeon] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.neon/.HelloNeon }
[2011-11-12 16:49:15 - HelloNeon] ------------------------------
[2011-11-12 16:49:15 - HelloNeon] Android Launch!
[2011-11-12 16:49:15 - HelloNeon] adb is running normally.
[2011-11-12 16:49:15 - HelloNeon] Performing com.example.neon.HelloNeon activity launch
[2011-11-12 16:49:15 - HelloNeon] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:49:18 - HelloNeon] WARNING: Application does not specify an API level requirement!
[2011-11-12 16:49:18 - HelloNeon] Device API version is 11 (Android 3.0.1)
[2011-11-12 16:49:18 - HelloNeon] Application already deployed. No need to reinstall.
[2011-11-12 16:49:18 - HelloNeon] Starting activity com.example.neon.HelloNeon on device 33c20c143608197
[2011-11-12 16:49:19 - HelloNeon] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.neon/.HelloNeon }
[2011-11-12 16:52:11 - HelloNeon] ------------------------------
[2011-11-12 16:52:11 - HelloNeon] Android Launch!
[2011-11-12 16:52:11 - HelloNeon] adb is running normally.
[2011-11-12 16:52:11 - HelloNeon] Performing com.example.neon.HelloNeon activity launch
[2011-11-12 16:52:11 - HelloNeon] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:52:13 - HelloNeon] WARNING: Application does not specify an API level requirement!
[2011-11-12 16:52:13 - HelloNeon] Device API version is 11 (Android 3.0.1)
[2011-11-12 16:52:13 - HelloNeon] Application already deployed. No need to reinstall.
[2011-11-12 16:52:13 - HelloNeon] Starting activity com.example.neon.HelloNeon on device 33c20c143608197
[2011-11-12 16:52:13 - HelloNeon] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.neon/.HelloNeon }
[2011-11-12 16:58:47 - HelloNeon] ------------------------------
[2011-11-12 16:58:47 - HelloNeon] Android Launch!
[2011-11-12 16:58:47 - HelloNeon] adb is running normally.
[2011-11-12 16:58:47 - HelloNeon] Performing com.example.neon.HelloNeon activity launch
[2011-11-12 16:58:47 - HelloNeon] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-11-12 16:58:52 - HelloNeon] WARNING: Application does not specify an API level requirement!
[2011-11-12 16:58:52 - HelloNeon] Device API version is 11 (Android 3.0.1)
[2011-11-12 16:58:52 - HelloNeon] Application already deployed. No need to reinstall.
[2011-11-12 16:58:52 - HelloNeon] Starting activity com.example.neon.HelloNeon on device 33c20c143608197
[2011-11-12 16:58:53 - HelloNeon] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.neon/.HelloNeon }

На экране при запуске я получаю сообщение об ошибке:

"Извините! Приложение HelloNeon (процесс com.example.neon) неожиданно остановилось. Пожалуйста, повторите попытку."

1 Ответ

1 голос
/ 12 ноября 2011

Я предполагаю, что ошибка «Приложение HellowNeon (процесс com.example.neon) неожиданно остановилось. Пожалуйста, попробуйте еще раз :-)».Таким образом, вы можете

Отфильтровать ваш журнал просто как Error и искать FATAL EXCEPTION

Также вы можете отлаживать, устанавливая точки останова в Eclipse. Выберите «Debug» вместо стандартного «Run», который будетпозволить вам пройти и так далее.

...