Autore Topic: crash  (Letto 437 volte)

Offline Rino63

  • Utente normale
  • ***
  • Post: 161
  • Respect: +3
    • Mostra profilo
crash
« il: 19 Febbraio 2014, 11:07:42 CET »
0
ciao a tutti, la mia app di prova crasha in partenza e non riesco a capire perchè. metto qui il log e il manifest. qualche anima buona ha qualche idea?

02-19 09:58:06.869: W/ActivityThread(533): Application com.rino.testimmagini is waiting for the debugger on port 8100...
02-19 09:58:06.899: I/System.out(533): Sending WAIT chunk
02-19 09:58:07.049: I/dalvikvm(533): Debugger is active
02-19 09:58:07.109: I/System.out(533): Debugger has connected
02-19 09:58:07.109: I/System.out(533): waiting for debugger to settle...
02-19 09:58:07.309: I/System.out(533): waiting for debugger to settle...
02-19 09:58:07.359: I/dalvikvm(533): threadid=3: reacting to signal 3
02-19 09:58:07.419: I/dalvikvm(533): Wrote stack traces to '/data/anr/traces.txt'
02-19 09:58:07.519: I/System.out(533): waiting for debugger to settle...
02-19 09:58:07.719: I/System.out(533): waiting for debugger to settle...
02-19 09:58:07.859: I/dalvikvm(533): threadid=3: reacting to signal 3
02-19 09:58:07.899: I/dalvikvm(533): Wrote stack traces to '/data/anr/traces.txt'
02-19 09:58:07.919: I/System.out(533): waiting for debugger to settle...
02-19 09:58:08.119: I/System.out(533): waiting for debugger to settle...
02-19 09:58:08.382: I/System.out(533): waiting for debugger to settle...
02-19 09:58:08.439: I/dalvikvm(533): threadid=3: reacting to signal 3
02-19 09:58:08.459: I/dalvikvm(533): Wrote stack traces to '/data/anr/traces.txt'
02-19 09:58:08.624: I/System.out(533): waiting for debugger to settle...
02-19 09:58:08.833: I/System.out(533): waiting for debugger to settle...
02-19 09:58:08.989: I/dalvikvm(533): threadid=3: reacting to signal 3
02-19 09:58:09.009: I/dalvikvm(533): Wrote stack traces to '/data/anr/traces.txt'
02-19 09:58:09.029: I/System.out(533): waiting for debugger to settle...
02-19 09:58:09.261: I/System.out(533): waiting for debugger to settle...
02-19 09:58:09.479: I/System.out(533): debugger has settled (1481)
02-19 09:58:09.579: I/dalvikvm(533): threadid=3: reacting to signal 3
02-19 09:58:09.719: I/dalvikvm(533): Wrote stack traces to '/data/anr/traces.txt'
02-19 09:58:09.929: D/AndroidRuntime(533): Shutting down VM
02-19 09:58:09.929: W/dalvikvm(533): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-19 09:58:10.019: I/dalvikvm(533): threadid=3: reacting to signal 3
02-19 09:58:10.119: E/AndroidRuntime(533): FATAL EXCEPTION: main
02-19 09:58:10.119: E/AndroidRuntime(533): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

{com.rino.testimmagini/com.rino.testimmagini.MainActivity}: java.lang.NullPointerException
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.os.Handler.dispatchMessage(Handler.java:99)
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.os.Looper.loop(Looper.java:137)
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.ActivityThread.main(ActivityThread.java:4424)
02-19 09:58:10.119: E/AndroidRuntime(533):    at java.lang.reflect.Method.invokeNative(Native Method)
02-19 09:58:10.119: E/AndroidRuntime(533):    at java.lang.reflect.Method.invoke(Method.java:511)
02-19 09:58:10.119: E/AndroidRuntime(533):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-19 09:58:10.119: E/AndroidRuntime(533):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-19 09:58:10.119: E/AndroidRuntime(533):    at dalvik.system.NativeStart.main(Native Method)
02-19 09:58:10.119: E/AndroidRuntime(533): Caused by: java.lang.NullPointerException
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.Activity.findViewById(Activity.java:1794)
02-19 09:58:10.119: E/AndroidRuntime(533):    at com.rino.testimmagini.MainActivity.<init>(MainActivity.java:36)
02-19 09:58:10.119: E/AndroidRuntime(533):    at java.lang.Class.newInstanceImpl(Native Method)
02-19 09:58:10.119: E/AndroidRuntime(533):    at java.lang.Class.newInstance(Class.java:1319)
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
02-19 09:58:10.119: E/AndroidRuntime(533):    ... 11 more
02-19 09:58:10.129: I/dalvikvm(533): Wrote stack traces to '/data/anr/traces.txt'
02-19 09:58:10.528: I/dalvikvm(533): threadid=3: reacting to signal 3
02-19 09:58:10.568: I/dalvikvm(533): Wrote stack traces to '/data/anr/traces.txt'
02-19 09:58:10.908: I/dalvikvm(533): threadid=3: reacting to signal 3
02-19 09:58:10.938: I/dalvikvm(533): Wrote stack traces to '/data/anr/traces.txt'
02-19 09:58:13.478: I/Process(533): Sending signal. PID: 533 SIG: 9


manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.rino.testimmagini"
    android:versionCode="1"
    android:versionName="1.0" >
 <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="18"
          />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
       
        <activity
            android:name="com.rino.testimmagini.MainActivity"
            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>
    </application>

</manifest>

credo che la riga incriminata sia questa: 02-19 09:58:10.119: E/AndroidRuntime(533): Caused by: java.lang.NullPointerException ma non riesco a risalire al colpevole(sicuramente qualcosa non inizializzato o non inizializzato nel modo giusto). domanda tecnica su eclipse (che non conosco benissimo....)come faccio a risalire ad un numero di riga in eclipse? cioè se il debugger mi dice linea 1080 come faccio ad andare nel codice a quella riga? grazie per l'attenzione.


Offline bradipao

  • Moderatore globale
  • Utente storico
  • *****
  • Post: 4043
  • keep it simple
  • Respect: +567
    • Github
    • Google+
    • bradipao
    • Mostra profilo
  • Dispositivo Android:
    Nexus 5
  • Play Store ID:
    Bradipao
  • Sistema operativo:
    W7
Re:crash
« Risposta #1 il: 19 Febbraio 2014, 11:09:53 CET »
0
come faccio a risalire ad un numero di riga in eclipse?

E' scritto nel logcat che hai postato:

Citazione
02-19 09:58:10.119: E/AndroidRuntime(533):    at com.rino.testimmagini.MainActivity.<init>(MainActivity.java:36)

Basta che in tutto lo stacktrace tu individui la riga dove è presente un tuo file java.
NON rispondo a domande nei messaggi privati
Bradipao @ Play Store

Offline Rino63

  • Utente normale
  • ***
  • Post: 161
  • Respect: +3
    • Mostra profilo
Re:crash
« Risposta #2 il: 19 Febbraio 2014, 11:21:20 CET »
0
grazie, provo a verificare

Offline GabMarioPower

  • Moderatore globale
  • Utente senior
  • *****
  • Post: 606
  • Respect: +152
    • Github
    • Google+
    • gabrielemariotti
    • GabMarioPower
    • Mostra profilo
  • Play Store ID:
    GAB+MARIO+DEV
  • Sistema operativo:
    Ubuntu 14.04 , Win 10
Re:crash
« Risposta #3 il: 19 Febbraio 2014, 12:10:40 CET »
0
Codice (Java): [Seleziona]
02-19 09:58:10.119: E/AndroidRuntime(533): Caused by: java.lang.NullPointerException
02-19 09:58:10.119: E/AndroidRuntime(533):    at android.app.Activity.findViewById(Activity.java:1794)
02-19 09:58:10.119: E/AndroidRuntime(533):    at com.rino.testimmagini.MainActivity.<init>(MainActivity.java:36)

Per caso stai facendo un findViewById direttamente nel costruttore?



Offline Rino63

  • Utente normale
  • ***
  • Post: 161
  • Respect: +3
    • Mostra profilo
Re:crash
« Risposta #4 il: 19 Febbraio 2014, 12:41:09 CET »
0
grazie  GabMarioPower hai ragione tu facevo proprio quello adesso l'ho spostato e tutto funziona GRAZIE!!!!!!!!!!!