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

ImageView verursacht Probleme

Dieses Thema im Forum "Android App Entwicklung" wurde erstellt von killerhamster, 23.05.2011.

  1. killerhamster, 23.05.2011 #1
    killerhamster

    killerhamster Threadstarter Neuer Benutzer

    Beiträge:
    1
    Erhaltene Danke:
    0
    Registriert seit:
    23.05.2011
    Moin, Beschäftige mich nun seit ein paar Tagen mit Android und komme soweit gut vorran, was das Verständnis der einzelnen Sachen angeht.

    Nun habe ich mich entschieden eine erste App zu machen (just4fun) die mit der Twitter API interagiert. Das klappt alles probleme, doch nun hatte ich vor das Profilbild anzeigenzulassen und dafür brauche ich natürlich ein imageview.
    Problem ist, sobald ich ein imageview in mein Projekt einbaue, stürzt die App beim start immer ab.

    Habe hier mal die Logs die mir ausgespuckt werden:
    Code:
    05-23 13:15:25.537: ERROR/AndroidRuntime(1659): ERROR: thread attach failed
    05-23 13:15:30.238: ERROR/AndroidRuntime(1676): Uncaught handler: thread main exiting due to uncaught exception
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ecs.android.sample.twitter/com.ecs.android.sample.twitter.AndroidTwitterSample}: android.view.InflateException: Binary XML file line #31: Error inflating class java.lang.reflect.Constructor
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.os.Handler.dispatchMessage(Handler.java:99)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.os.Looper.loop(Looper.java:123)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.app.ActivityThread.main(ActivityThread.java:3948)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at java.lang.reflect.Method.invokeNative(Native Method)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at java.lang.reflect.Method.invoke(Method.java:521)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at dalvik.system.NativeStart.main(Native Method)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676): Caused by: android.view.InflateException: Binary XML file line #31: Error inflating class java.lang.reflect.Constructor
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.view.LayoutInflater.createView(LayoutInflater.java:512)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.app.Activity.setContentView(Activity.java:1626)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at com.ecs.android.sample.twitter.AndroidTwitterSample.onCreate(AndroidTwitterSample.java:37)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     ... 11 more
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676): Caused by: java.lang.reflect.InvocationTargetException
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.widget.ImageView.<init>(ImageView.java:103)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at java.lang.reflect.Constructor.constructNative(Native Method)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.view.LayoutInflater.createView(LayoutInflater.java:499)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     ... 22 more
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676): Caused by: android.content.res.Resources$NotFoundException: File res/color/primary_text_light.xml from drawable resource ID #0x7f020000
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.content.res.Resources.loadDrawable(Resources.java:1625)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.widget.ImageView.<init>(ImageView.java:113)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     ... 26 more
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676): Caused by: android.content.res.Resources$NotFoundException: File res/color/primary_text_light.xml from xml type drawable resource ID #0x7f020000
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:1843)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.content.res.Resources.loadDrawable(Resources.java:1620)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     ... 28 more
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676): Caused by: java.io.FileNotFoundException: res/color/primary_text_light.xml
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.content.res.AssetManager.openXmlAssetNative(Native Method)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:471)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:1825)
    05-23 13:15:30.317: ERROR/AndroidRuntime(1676):     ... 29 more
    
    Sobald ich das imageview wieder entferne funktioniert wieder alles.

    Ist halt doof, da ich imageviews brauche ;-)
    Hoffe mir kann jemand helfen.

    Lg.Killerhamster
     

Diese Seite empfehlen