LogCat. Come tracciare un bug?

Sono nuovo al debug Android. Ho letto su logCat e DDMS sulle funzioni che hanno e sul filtraggio.

Ma, non capisco come eseguire il debug del mio codice con logCat. ho classificato il mio logcat da errore. e ho ottenuto 30 errori relativi a tutti i tipi di problemi, che vanno dalle emissioni sonore alle problematiche della batteria ai problemi principali …

  • Come fermare la tastiera Soft che viene visualizzata automaticamente quando viene cambiato il fuoco (evento OnStart)
  • Ottenere l'icona App in Android
  • Montare una scheda SD manualmente dalla shell adb in android
  • Indirizzamento esplicito di un intento a un ricevitore dinamico
  • come mantenere RecyclerView sempre scorrere verso il basso
  • Accesso al context android in applicazione ndk
  • 04-20 06:31:09.982: ERROR/Zygote(33): setreuid() failed. errno: 2 04-20 06:31:16.872: ERROR/Zygote(33): setreuid() failed. errno: 17 04-20 06:31:18.064: ERROR/BatteryService(60): usbOnlinePath not found 04-20 06:31:18.064: ERROR/BatteryService(60): batteryVoltagePath not found 04-20 06:31:18.064: ERROR/BatteryService(60): batteryTemperaturePath not found 04-20 06:31:18.082: ERROR/SurfaceFlinger(60): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake 04-20 06:31:23.482: ERROR/EventHub(60): could not get driver version for /dev/input/mouse0, Not a typewriter 04-20 06:31:23.482: ERROR/EventHub(60): could not get driver version for /dev/input/mice, Not a typewriter 04-20 06:31:23.692: ERROR/System(60): Failure starting core service 04-20 06:31:23.692: ERROR/System(60): java.lang.SecurityException 04-20 06:31:23.692: ERROR/System(60): at android.os.BinderProxy.transact(Native Method) 04-20 06:31:23.692: ERROR/System(60): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146) 04-20 06:31:23.692: ERROR/System(60): at android.os.ServiceManager.addService(ServiceManager.java:72) 04-20 06:31:23.692: ERROR/System(60): at com.android.server.ServerThread.run(SystemServer.java:184) 04-20 06:31:24.602: ERROR/SoundPool(60): error loading /system/media/audio/ui/Effect_Tick.ogg 04-20 06:31:24.602: ERROR/SoundPool(60): error loading /system/media/audio/ui/KeypressStandard.ogg 04-20 06:31:24.602: ERROR/SoundPool(60): error loading /system/media/audio/ui/KeypressSpacebar.ogg 04-20 06:31:24.612: ERROR/SoundPool(60): error loading /system/media/audio/ui/KeypressDelete.ogg 04-20 06:31:24.622: ERROR/SoundPool(60): error loading /system/media/audio/ui/KeypressReturn.ogg 04-20 06:31:26.411: ERROR/ThrottleService(60): Could not open GPS configuration file /etc/gps.conf 04-20 06:31:27.751: ERROR/logwrapper(149): executing /system/bin/tc failed: No such file or directory 04-20 06:31:27.792: ERROR/logwrapper(150): executing /system/bin/tc failed: No such file or directory 04-20 06:31:27.823: ERROR/logwrapper(151): executing /system/bin/tc failed: No such file or directory 04-20 06:31:37.841: ERROR/HierarchicalStateMachine(60): TetherMaster - unhandledMessage: msg.what=3 04-20 06:31:58.767: ERROR/AndroidRuntime(277): FATAL EXCEPTION: main 04-20 06:31:58.767: ERROR/AndroidRuntime(277): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.markana.yamba/com.markana.yamba.StatusActivity1}: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 in loader dalvik.system.PathClassLoader[/data/app/com.markana.yamba-2.apk] 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.os.Handler.dispatchMessage(Handler.java:99) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.os.Looper.loop(Looper.java:123) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at java.lang.reflect.Method.invokeNative(Native Method) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at java.lang.reflect.Method.invoke(Method.java:521) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at dalvik.system.NativeStart.main(Native Method) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): Caused by: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 in loader dalvik.system.PathClassLoader[/data/app/com.markana.yamba-2.apk] 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577) 04-20 06:31:58.767: ERROR/AndroidRuntime(277): ... 11 more 04-20 07:30:54.993: ERROR/Zygote(33): setreuid() failed. errno: 2 04-20 07:31:02.125: ERROR/Zygote(33): setreuid() failed. errno: 17 04-20 07:31:03.243: ERROR/BatteryService(59): usbOnlinePath not found 04-20 07:31:03.243: ERROR/BatteryService(59): batteryVoltagePath not found 04-20 07:31:03.243: ERROR/BatteryService(59): batteryTemperaturePath not found 04-20 07:31:03.273: ERROR/SurfaceFlinger(59): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake 04-20 07:31:09.004: ERROR/EventHub(59): could not get driver version for /dev/input/mouse0, Not a typewriter 04-20 07:31:09.004: ERROR/EventHub(59): could not get driver version for /dev/input/mice, Not a typewriter 04-20 07:31:09.265: ERROR/System(59): Failure starting core service 04-20 07:31:09.265: ERROR/System(59): java.lang.SecurityException 04-20 07:31:09.265: ERROR/System(59): at android.os.BinderProxy.transact(Native Method) 04-20 07:31:09.265: ERROR/System(59): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146) 04-20 07:31:09.265: ERROR/System(59): at android.os.ServiceManager.addService(ServiceManager.java:72) 04-20 07:31:09.265: ERROR/System(59): at com.android.server.ServerThread.run(SystemServer.java:184) 04-20 07:31:10.843: ERROR/SoundPool(59): error loading /system/media/audio/ui/Effect_Tick.ogg 04-20 07:31:10.865: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressStandard.ogg 04-20 07:31:10.865: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressSpacebar.ogg 04-20 07:31:10.873: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressDelete.ogg 04-20 07:31:10.884: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressReturn.ogg 04-20 07:31:12.824: ERROR/ThrottleService(59): Could not open GPS configuration file /etc/gps.conf 04-20 07:31:14.294: ERROR/logwrapper(149): executing /system/bin/tc failed: No such file or directory 04-20 07:31:14.364: ERROR/logwrapper(150): executing /system/bin/tc failed: No such file or directory 04-20 07:31:14.403: ERROR/logwrapper(152): executing /system/bin/tc failed: No such file or directory 04-20 07:31:26.859: ERROR/HierarchicalStateMachine(59): TetherMaster - unhandledMessage: msg.what=3 04-20 07:31:49.188: ERROR/AndroidRuntime(298): FATAL EXCEPTION: main 04-20 07:31:49.188: ERROR/AndroidRuntime(298): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.markana.yamba/com.markana.yamba.StatusActivity1}: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 in loader dalvik.system.PathClassLoader[/data/app/com.markana.yamba-1.apk] 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.os.Handler.dispatchMessage(Handler.java:99) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.os.Looper.loop(Looper.java:123) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at java.lang.reflect.Method.invokeNative(Native Method) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at java.lang.reflect.Method.invoke(Method.java:521) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at dalvik.system.NativeStart.main(Native Method) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): Caused by: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 in loader dalvik.system.PathClassLoader[/data/app/com.markana.yamba-1.apk] 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577) 04-20 07:31:49.188: ERROR/AndroidRuntime(298): ... 11 more 04-20 07:33:45.057: ERROR/AndroidRuntime(369): FATAL EXCEPTION: main 04-20 07:33:45.057: ERROR/AndroidRuntime(369): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.markana.yamba/com.markana.yamba.StatusActivity1}: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 in loader dalvik.system.PathClassLoader[/data/app/com.markana.yamba-1.apk] 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.os.Handler.dispatchMessage(Handler.java:99) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.os.Looper.loop(Looper.java:123) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at java.lang.reflect.Method.invokeNative(Native Method) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at java.lang.reflect.Method.invoke(Method.java:521) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at dalvik.system.NativeStart.main(Native Method) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): Caused by: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 in loader dalvik.system.PathClassLoader[/data/app/com.markana.yamba-1.apk] 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577) 04-20 07:33:45.057: ERROR/AndroidRuntime(369): ... 11 more 04-20 07:33:58.677: ERROR/AndroidRuntime(412): FATAL EXCEPTION: main 04-20 07:33:58.677: ERROR/AndroidRuntime(412): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.markana.yamba/com.markana.yamba.StatusActivity1}: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 in loader dalvik.system.PathClassLoader[/data/app/com.markana.yamba-2.apk] 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.os.Handler.dispatchMessage(Handler.java:99) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.os.Looper.loop(Looper.java:123) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at java.lang.reflect.Method.invokeNative(Native Method) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at java.lang.reflect.Method.invoke(Method.java:521) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at dalvik.system.NativeStart.main(Native Method) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): Caused by: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 in loader dalvik.system.PathClassLoader[/data/app/com.markana.yamba-2.apk] 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577) 04-20 07:33:58.677: ERROR/AndroidRuntime(412): ... 11 more 

    Il mio codice nella class è abbastanza semplice, ho fatto quello che l'esempio nel libro Android Orielly ha fatto:

     package com.markana.yamba; import winterwell.jtwitter.Twitter; import winterwell.jtwitter.TwitterException; import android.app.Activity; import android.graphics.Color; import android.os.AsyncTask; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class StatusActivity2 extends Activity implements OnClickListener{ private static final String TAG= "StatusActivity"; EditText editText; Button updateButton; TextView textCount; Twitter twitter; /** Called when the activity is first created. */ @SuppressWarnings("deprecation") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.status); //Finds views editText =(EditText) findViewById(R.id.editText); updateButton=(Button) findViewById(R.id.buttonUpdate); updateButton.setOnClickListener(this); textCount= (TextView) findViewById(R.id.editText); textCount.setText(Integer.toString(40)); textCount.setTextColor(Color.GREEN); // editText.addTextChangedListener(this); twitter=new Twitter("student","password"); twitter.setAPIRootUrl(("http://yamba.marakana.com/api")); //added by me AsyncTask<String, ?, ?> asyn=new PostToTwitter(); asyn.execute("deliver this to twitter"); } class PostToTwitter extends AsyncTask<String,Integer, String> { @Override protected String doInBackground(String... statuses) { try{ Twitter.Status status=twitter.updateStatus(statuses[0]); return status.text; } catch(TwitterException e) { Log.e(TAG,e.toString()); e.printStackTrace(); return "Failed to post"; } } protected void onProgressUpdate(Integer...values) { super.onProgressUpdate(values); } protected void onPostExecute(String result) { Toast.makeText(StatusActivity2.this,result,Toast.LENGTH_LONG).show(); } } public void onClick(View arg0) { // TODO Auto-generated method stub String status=editText.getText().toString(); new PostToTwitter().execute(status); Log.d(TAG, "onClick"); } } 

    Non ho segni di errore rossi, né qui né nei file main.xml, string.xml

    Come posso tracciare il mio bug?

  • Sessione Android SDK di Facebook openForPublish non creando una nuova session
  • Attività Android chiama un altro metodo Attività
  • come impostare una visualizzazione di elenco personalizzato in una window di dialogo
  • Widget dello schermo di block Android
  • Portale Google OAuth 2.0 e Captive con browser incorporato
  • BasicAuthentication in android per la visualizzazione web non funzionante
  • One Solution collect form web for “LogCat. Come tracciare un bug?”

    Basta leggere l'output per trovare

     Caused by: java.lang.ClassNotFoundException: com.markana.yamba.StatusActivity1 

    Ciò significa che questa class manca .apk che hai distribuito al dispositivo.

    Tieni presente che la tua attività è denominata StatusActivity2 – controlla doppio il manifesto se ancora ha StatusActivity1 .

    L'Android è un fan Android di Google, tutto su telefoni Android, Android Wear, Android Dev e applicazioni Android Games e così via.