1. Nimm jetzt an unserem Uhans - 3. ADVENT - Gewinnspiel teil - Alle Informationen findest Du hier!

App startet nicht

Dieses Thema im Forum "Android App Entwicklung" wurde erstellt von Daninator, 19.06.2011.

  1. Daninator, 19.06.2011 #1
    Daninator

    Daninator Threadstarter Neuer Benutzer

    Beiträge:
    1
    Erhaltene Danke:
    0
    Registriert seit:
    19.06.2011
    Hallo Leute,
    Ich bin der Dani und neu im Forum
    ich versuche grad an Hand eines Stpck Codes denn ich im Internet gefunden habe eine App zu erstellen di App soll in ein bild rein und raus zoomen können nur jedes mal wenn ich die App Emulieren möchte kommt der Fehler:

    The application (process dani.cmp) has stopped unexspectedly. Please try again.

    Mein Code ist folgender:
    Zoom Klasse
    Code:
    package dani.cmp;
    import android.content.Context;
        import android.graphics.Canvas;
        import android.graphics.drawable.Drawable;
        import android.view.KeyEvent;
    import android.view.View;
         
        public class Zoom extends View {
                private Drawable image;
                private int zoomControler=20;
                public Zoom(Context context)
                {
                        super(context);
                        image=this.getResources().getDrawable(R.drawable.icon);
                        setFocusable(true);
                       
                }
                @Override
                protected void onDraw(Canvas canvas) {
                        // TODO Auto-generated method stub
                        super.onDraw(canvas);
                //here u can control the width and height of the images........ this line is very important
                image.setBounds((getWidth()/2)-zoomControler, (getHeight()/2)-zoomControler, (getWidth()/2)+zoomControler, (getHeight()/2)+zoomControler);
                        image.draw(canvas);
                }
                @Override
                public boolean onKeyDown(int keyCode, KeyEvent event) {
                       
                        if(keyCode==KeyEvent.KEYCODE_DPAD_UP)// zoom in
                                zoomControler+=10;
                        if(keyCode==KeyEvent.KEYCODE_DPAD_DOWN) // zoom out
                                zoomControler-=10;
                        if(zoomControler<10)
                                zoomControler=10;
                       
                        invalidate();
                        return true;
                }
        }
         
    Zooming Klasse:
    Code:
    ackage dani.cmp;
    
    import android.app.Activity;
    import android.os.Bundle;
     
    public class zooming extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle icicle) {
            super.onCreate(icicle);
            setContentView(new Zoom(this));
        }
    }
    
    XML code:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
    <TextView  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/hello"
        />
    </LinearLayout>
    
    Und das Logcat File habe ich schon versucht zu analysieren leider bin ich auf keine Lösung gekommen :/
    eInit.java:618)

    E/AndroidRuntime( 757): at dalvik.system.NativeStart.main(Native Method)

    E/AndroidRuntime( 757): Caused by: java.lang.InstantiationException: dani.cmp.Z
    oom
    E/AndroidRuntime( 757): at java.lang.Class.newInstanceImpl(Native Method
    )
    E/AndroidRuntime( 757): at java.lang.Class.newInstance(Class.java:1479)
    E/AndroidRuntime( 757): at android.app.Instrumentation.newActivity(Instr
    umentation.java:1021)
    E/AndroidRuntime( 757): at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2409)
    E/AndroidRuntime( 757): ... 11 more
    I/Process ( 51): Sending signal. PID: 757 SIG: 3
    I/dalvikvm( 757): threadid=7: reacting to signal 3
    E/dalvikvm( 757): Unable to open stack trace file '/data/anr/traces.txt': Permi
    ssion denied
    I/Process ( 757): Sending signal. PID: 757 SIG: 9
    I/ActivityManager( 51): Process dani.cmp (pid 757) has died.
    I/UsageStats( 51): Unexpected resume of com.android.launcher while already res
    umed in dani.cmp
    W/InputManagerService( 51): Window already focused, ignoring focus gain of: co
    m.android.internal.view.IInputMethodClient$Stub$Proxy@44d17880
    D/dalvikvm( 51): threadid=15: bogus mon 1+0>0; adjusting
    D/AndroidRuntime( 765):
    D/AndroidRuntime( 765): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
    D/AndroidRuntime( 765): CheckJNI is ON
    D/AndroidRuntime( 765): --- registering native functions ---
    D/ddm-heap( 765): Got feature list request
    D/PackageParser( 51): Scanning package: /data/app/vmdl68848.tmp
    I/PackageParser( 51): dani.cmp: compat added android.permission.WRITE_EXTERNAL
    _STORAGE android.permission.READ_PHONE_STATE
    I/PackageManager( 51): Removing non-system package:dani.cmp
    D/PackageManager( 51): Removing package dani.cmp
    D/PackageManager( 51): Activities: dani.cmp.Zoom
    D/PackageManager( 51): Scanning package dani.cmp
    I/PackageManager( 51): /data/app/vmdl68848.tmp changed; unpacking
    D/installd( 31): DexInv: --- BEGIN '/data/app/vmdl68848.tmp' ---
    D/dalvikvm( 771): DexOpt: load 33ms, verify 9ms, opt 1ms
    D/installd( 31): DexInv: --- END '/data/app/vmdl68848.tmp' (success) ---
    D/PackageManager( 51): Activities: dani.cmp.Zoom
    D/ActivityManager( 51): Uninstalling process dani.cmp
    I/installd( 31): move /data/dalvik-cache/data@app@vmdl68848.tmp@classes.dex ->
    /data/dalvik-cache/data@app@dani.cmp.apk@classes.dex
    D/PackageManager( 51): New package installed in /data/app/dani.cmp.apk
    D/AndroidRuntime( 765): Shutting down VM
    D/dalvikvm( 765): DestroyJavaVM waiting for non-daemon threads to exit
    D/dalvikvm( 765): DestroyJavaVM shutting VM down
    D/dalvikvm( 765): HeapWorker thread shutting down
    D/dalvikvm( 765): HeapWorker thread has shut down
    D/jdwp ( 765): JDWP shutting down net...
    I/dalvikvm( 765): Debugger has detached; object registry had 1 entries
    D/dalvikvm( 765): VM cleaning up
    E/AndroidRuntime( 765): ERROR: thread attach failed
    D/dalvikvm( 765): LinearAlloc 0x0 used 623916 of 5242880 (11%)
    D/ActivityManager( 51): Uninstalling process dani.cmp
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    700e5
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    20031
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    20030
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    50000
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    60000
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    60001
    D/dalvikvm( 98): GC freed 2572 objects / 144256 bytes in 220ms
    D/dalvikvm( 51): GC freed 11559 objects / 710824 bytes in 209ms
    D/dalvikvm( 51): GC freed 1104 objects / 61080 bytes in 219ms
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    700e5
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    20031
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    20030
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    50000
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    60000
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    60001
    D/AndroidRuntime( 776):
    D/AndroidRuntime( 776): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
    D/AndroidRuntime( 776): CheckJNI is ON
    D/AndroidRuntime( 776): --- registering native functions ---
    D/ddm-heap( 776): Got feature list request
    I/ActivityManager( 51): Starting activity: Intent { act=android.intent.action.
    MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=dani.cmp/.Zoom }
    I/ActivityManager( 51): Start proc dani.cmp for activity dani.cmp/.Zoom: pid=7
    82 uid=10030 gids={1015}
    D/AndroidRuntime( 776): Shutting down VM
    D/dalvikvm( 776): DestroyJavaVM waiting for non-daemon threads to exit
    D/dalvikvm( 776): DestroyJavaVM shutting VM down
    D/dalvikvm( 776): HeapWorker thread shutting down
    D/dalvikvm( 776): HeapWorker thread has shut down
    D/jdwp ( 776): JDWP shutting down net...
    I/dalvikvm( 776): Debugger has detached; object registry had 1 entries
    D/dalvikvm( 776): VM cleaning up
    E/AndroidRuntime( 776): ERROR: thread attach failed
    D/dalvikvm( 776): LinearAlloc 0x0 used 639500 of 5242880 (12%)
    D/ddm-heap( 782): Got feature list request
    D/dalvikvm( 782): newInstance failed: no <init>()
    D/AndroidRuntime( 782): Shutting down VM
    W/dalvikvm( 782): threadid=3: thread exiting with uncaught exception (group=0x4
    001b188)
    E/AndroidRuntime( 782): Uncaught handler: thread main exiting due to uncaught e
    xception
    E/AndroidRuntime( 782): java.lang.RuntimeException: Unable to instantiate activ
    ity ComponentInfo{dani.cmp/dani.cmp.Zoom}: java.lang.InstantiationException: dan
    i.cmp.Zoom
    E/AndroidRuntime( 782): at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2417)
    E/AndroidRuntime( 782): at android.app.ActivityThread.handleLaunchActivi
    ty(ActivityThread.java:2512)
    E/AndroidRuntime( 782): at android.app.ActivityThread.access$2200(Activi
    tyThread.java:119)
    E/AndroidRuntime( 782): at android.app.ActivityThread$H.handleMessage(Ac
    tivityThread.java:1863)
    E/AndroidRuntime( 782): at android.os.Handler.dispatchMessage(Handler.ja
    va:99)
    E/AndroidRuntime( 782): at android.os.Looper.loop(Looper.java:123)
    E/AndroidRuntime( 782): at android.app.ActivityThread.main(ActivityThrea
    d.java:4363)
    E/AndroidRuntime( 782): at java.lang.reflect.Method.invokeNative(Native
    Method)
    E/AndroidRuntime( 782): at java.lang.reflect.Method.invoke(Method.java:5
    21)
    E/AndroidRuntime( 782): at com.android.internal.os.ZygoteInit$MethodAndA
    rgsCaller.run(ZygoteInit.java:860)
    E/AndroidRuntime( 782): at com.android.internal.os.ZygoteInit.main(Zygot
    eInit.java:618)
    E/AndroidRuntime( 782): at dalvik.system.NativeStart.main(Native Method)

    E/AndroidRuntime( 782): Caused by: java.lang.InstantiationException: dani.cmp.Z
    oom
    E/AndroidRuntime( 782): at java.lang.Class.newInstanceImpl(Native Method
    )
    E/AndroidRuntime( 782): at java.lang.Class.newInstance(Class.java:1479)
    E/AndroidRuntime( 782): at android.app.Instrumentation.newActivity(Instr
    umentation.java:1021)
    E/AndroidRuntime( 782): at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2409)
    E/AndroidRuntime( 782): ... 11 more
    I/Process ( 51): Sending signal. PID: 782 SIG: 3
    I/dalvikvm( 782): threadid=7: reacting to signal 3
    E/dalvikvm( 782): Unable to open stack trace file '/data/anr/traces.txt': Permi
    ssion denied
    I/Process ( 782): Sending signal. PID: 782 SIG: 9
    I/ActivityManager( 51): Process dani.cmp (pid 782) has died.
    I/UsageStats( 51): Unexpected resume of com.android.launcher while already res
    umed in dani.cmp
    W/InputManagerService( 51): Window already focused, ignoring focus gain of: co
    m.android.internal.view.IInputMethodClient$Stub$Proxy@44e6f6b8
    E/gralloc ( 51): [unregister] handle 0x50ba08 still locked (state=40000001)
    D/dalvikvm( 204): GC freed 82 objects / 3912 bytes in 115ms
    D/AndroidRuntime( 791):
    D/AndroidRuntime( 791): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
    D/AndroidRuntime( 791): CheckJNI is ON
    D/AndroidRuntime( 791): --- registering native functions ---
    D/ddm-heap( 791): Got feature list request
    D/PackageParser( 51): Scanning package: /data/app/vmdl68849.tmp
    I/PackageParser( 51): dani.cmp: compat added android.permission.WRITE_EXTERNAL
    _STORAGE android.permission.READ_PHONE_STATE
    I/PackageManager( 51): Removing non-system package:dani.cmp
    D/PackageManager( 51): Removing package dani.cmp
    D/PackageManager( 51): Activities: dani.cmp.Zoom
    D/PackageManager( 51): Scanning package dani.cmp
    I/PackageManager( 51): /data/app/vmdl68849.tmp changed; unpacking
    D/installd( 31): DexInv: --- BEGIN '/data/app/vmdl68849.tmp' ---
    D/dalvikvm( 797): DexOpt: load 35ms, verify 11ms, opt 1ms
    D/installd( 31): DexInv: --- END '/data/app/vmdl68849.tmp' (success) ---
    D/PackageManager( 51): Activities: dani.cmp.Zoom
    D/ActivityManager( 51): Uninstalling process dani.cmp
    I/installd( 31): move /data/dalvik-cache/data@app@vmdl68849.tmp@classes.dex ->
    /data/dalvik-cache/data@app@dani.cmp.apk@classes.dex
    D/PackageManager( 51): New package installed in /data/app/dani.cmp.apk
    D/AndroidRuntime( 791): Shutting down VM
    D/dalvikvm( 791): DestroyJavaVM waiting for non-daemon threads to exit
    D/dalvikvm( 791): DestroyJavaVM shutting VM down
    D/dalvikvm( 791): HeapWorker thread shutting down
    D/dalvikvm( 791): HeapWorker thread has shut down
    D/jdwp ( 791): JDWP shutting down net...
    I/dalvikvm( 791): Debugger has detached; object registry had 1 entries
    D/dalvikvm( 791): VM cleaning up
    D/ActivityManager( 51): Uninstalling process dani.cmp
    E/AndroidRuntime( 791): ERROR: thread attach failed
    D/dalvikvm( 791): LinearAlloc 0x0 used 623916 of 5242880 (11%)
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    700e5
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    20031
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    20030
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    50000
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    60000
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    60001
    D/dalvikvm( 98): GC freed 2505 objects / 141000 bytes in 204ms
    D/dalvikvm( 51): GC freed 9670 objects / 645728 bytes in 198ms
    D/dalvikvm( 51): GC freed 919 objects / 39256 bytes in 191ms
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    700e5
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    20031
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    20030
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    50000
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    60000
    W/ResourceType( 51): Resources don't contain package for resource number 0x7f0
    60001
    D/AndroidRuntime( 802):
    D/AndroidRuntime( 802): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
    D/AndroidRuntime( 802): CheckJNI is ON
    D/AndroidRuntime( 802): --- registering native functions ---
    D/ddm-heap( 802): Got feature list request
    I/ActivityManager( 51): Starting activity: Intent { act=android.intent.action.
    MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=dani.cmp/.Zoom }
    I/ActivityManager( 51): Start proc dani.cmp for activity dani.cmp/.Zoom: pid=8
    08 uid=10030 gids={1015}
    D/AndroidRuntime( 802): Shutting down VM
    D/dalvikvm( 802): DestroyJavaVM waiting for non-daemon threads to exit
    D/dalvikvm( 802): DestroyJavaVM shutting VM down
    D/dalvikvm( 802): HeapWorker thread shutting down
    D/dalvikvm( 802): HeapWorker thread has shut down
    D/jdwp ( 802): JDWP shutting down net...
    I/dalvikvm( 802): Debugger has detached; object registry had 1 entries
    D/dalvikvm( 802): VM cleaning up
    E/AndroidRuntime( 802): ERROR: thread attach failed
    D/dalvikvm( 802): LinearAlloc 0x0 used 639500 of 5242880 (12%)
    D/dalvikvm( 29): GC freed 279 objects / 10808 bytes in 191ms
    D/ddm-heap( 808): Got feature list request
    D/dalvikvm( 29): GC freed 37 objects / 1576 bytes in 176ms
    D/dalvikvm( 808): newInstance failed: no <init>()
    D/AndroidRuntime( 808): Shutting down VM
    W/dalvikvm( 808): threadid=3: thread exiting with uncaught exception (group=0x4
    001b188)
    E/AndroidRuntime( 808): Uncaught handler: thread main exiting due to uncaught e
    xception
    I/ARMAssembler( 51): generated scanline__00000077:03010104_00000004_00000000 [
    22 ipp] (41 ins) at [0x49de40:0x49dee4] in 559208 ns
    E/AndroidRuntime( 808): java.lang.RuntimeException: Unable to instantiate activ
    ity ComponentInfo{dani.cmp/dani.cmp.Zoom}: java.lang.InstantiationException: dan
    i.cmp.Zoom
    E/AndroidRuntime( 808): at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2417)
    E/AndroidRuntime( 808): at android.app.ActivityThread.handleLaunchActivi
    ty(ActivityThread.java:2512)
    E/AndroidRuntime( 808): at android.app.ActivityThread.access$2200(Activi
    tyThread.java:119)
    E/AndroidRuntime( 808): at android.app.ActivityThread$H.handleMessage(Ac
    tivityThread.java:1863)
    E/AndroidRuntime( 808): at android.os.Handler.dispatchMessage(Handler.ja
    va:99)
    E/AndroidRuntime( 808): at android.os.Looper.loop(Looper.java:123)
    E/AndroidRuntime( 808): at android.app.ActivityThread.main(ActivityThrea
    d.java:4363)
    E/AndroidRuntime( 808): at java.lang.reflect.Method.invokeNative(Native
    Method)
    E/AndroidRuntime( 808): at java.lang.reflect.Method.invoke(Method.java:5
    21)
    E/AndroidRuntime( 808): at com.android.internal.os.ZygoteInit$MethodAndA
    rgsCaller.run(ZygoteInit.java:860)
    E/AndroidRuntime( 808): at com.android.internal.os.ZygoteInit.main(Zygot
    eInit.java:618)
    E/AndroidRuntime( 808): at dalvik.system.NativeStart.main(Native Method)

    E/AndroidRuntime( 808): Caused by: java.lang.InstantiationException: dani.cmp.Z
    oom
    E/AndroidRuntime( 808): at java.lang.Class.newInstanceImpl(Native Method
    )
    E/AndroidRuntime( 808): at java.lang.Class.newInstance(Class.java:1479)
    E/AndroidRuntime( 808): at android.app.Instrumentation.newActivity(Instr
    umentation.java:1021)
    E/AndroidRuntime( 808): at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2409)
    E/AndroidRuntime( 808): ... 11 more
    D/dalvikvm( 29): GC freed 2 objects / 48 bytes in 282ms
    I/Process ( 51): Sending signal. PID: 808 SIG: 3
    I/dalvikvm( 808): threadid=7: reacting to signal 3
    E/dalvikvm( 808): Unable to open stack trace file '/data/anr/traces.txt': Permi
    ssion denied
    W/ActivityManager( 51): Launch timeout has expired, giving up wake lock!
    W/ActivityManager( 51): Activity idle timeout for HistoryRecord{44cf21d0 dani.
    cmp/.Zoom}
    D/dalvikvm( 98): GC freed 2453 objects / 138864 bytes in 130ms
    D/dalvikvm( 204): GC freed 44 objects / 2056 bytes in 149ms
    I/Process ( 808): Sending signal. PID: 808 SIG: 9
    I/ActivityManager( 51): Process dani.cmp (pid 808) has died.
    I/UsageStats( 51): Unexpected resume of com.android.launcher while already res
    umed in dani.cmp
    W/InputManagerService( 51): Window already focused, ignoring focus gain of: co
    m.android.internal.view.IInputMethodClient$Stub$Proxy@44dabcc8
    E/gralloc ( 51): [unregister] handle 0x14bb40 still locked (state=40000001)

    I
    ch ihr könnt mir helfen bin noch ein relativer Anfänger was die Android Programmierung angeht
    mfg dani
     
  2. ko5tik, 19.06.2011 #2
    ko5tik

    ko5tik Android-Experte

    Beiträge:
    620
    Erhaltene Danke:
    40
    Registriert seit:
    14.10.2009
    Phone:
    HTC Hero
    Normalerweise haben die Activities einen Default-Constructor und initialisieren im onCreate()

    Lese mal den Tutorial über Lebenszyklus der Activities
     

Diese Seite empfehlen