0

First of all i know there are a lot of answered questions (like mine) out there but i simply can't find the right solution for me.

The error apears when starting the android app on phone. Note that on emulator works like a charm! :)

XML:

<?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"
    >

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:orientation="horizontal">
    <TextView
            android:id="@+id/tvDepartament"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/dept_text"
            android:padding="20dp"/>
    <Spinner
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/dptSelect"
            android:spinnerMode="dropdown"
            android:clickable="true"/>
</LinearLayout>

<ListView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/contactsList"
        android:layout_gravity="center_horizontal"/>


</LinearLayout>

Now, the erorr log: http://pastebin.com/LNWauPyC

Colours: http://pastebin.com/4SdHCgEq

3
  • what device? What version of android is the device running? Commented Apr 13, 2015 at 8:31
  • By looking at the log this seems related to an incorrect color attribute, probably in your theme or style: Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2. Please review your styles and post them for reference if you still need assistance. Commented Apr 13, 2015 at 8:32
  • I'm running on htc desire 500, developing with intellij IDEA! :) Android. 4.1.2 I've update main post with colours styles ! Commented Apr 13, 2015 at 8:44

2 Answers 2

1

The problem is

  • Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2 at android.content.res.TypedArray.getColor(TypedArray.java:326)

The code or id of the color is invalid.

Sign up to request clarification or add additional context in comments.

5 Comments

tryied to remove color usage but still same problem! :)
Url posted @ the end of OP
This is similar error log. Could you share the part of the source code? Thanks.
Have you seen this solution?: stackoverflow.com/questions/18741485/…
Yeap. Not using any of those attributes
0

I actually get it! The problem was with the custom theme i was trying to use. I think the main reason for that error came from trying to extend Material Light and that was incompatible with android version on my phone! :) If someone can confirm that i'll be gratefull!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.