Could not find class 'android.widget.ThemedSpinnerAdapter'

I am getting this weird error when I try to run my app on a pre API 21 device:

I/Choreographer: Skipped 39 frames!  The application may be doing too much work on its main thread.
12-10 07:58:44.179 4469-4472/projects.test.com.webviewtest D/dalvikvm: GC_CONCURRENT freed 156K, 4% free 4561K/4744K, paused 4ms+12ms, total 76ms
12-10 07:58:44.409 4469-4469/projects.test.com.webviewtest I/dalvikvm: Could not find method android.widget.Spinner.getPopupContext, referenced from method android.support.v7.widget.AppCompatSpinner.getPopupContext
12-10 07:58:44.409 4469-4469/projects.test.com.webviewtest W/dalvikvm: VFY: unable to resolve virtual method 18719: Landroid/widget/Spinner;.getPopupContext ()Landroid/content/Context;
12-10 07:58:44.409 4469-4469/projects.test.com.webviewtest D/dalvikvm: VFY: replacing opcode 0x6f at 0x000b
12-10 07:58:44.419 4469-4469/projects.test.com.webviewtest I/dalvikvm: Could not find method android.content.Context.getDrawable, referenced from method android.support.v7.widget.AppCompatSpinner.setPopupBackgroundResource
12-10 07:58:44.419 4469-4469/projects.test.com.webviewtest W/dalvikvm: VFY: unable to resolve virtual method 255: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable;
12-10 07:58:44.419 4469-4469/projects.test.com.webviewtest D/dalvikvm: VFY: replacing opcode 0x6e at 0x0004
12-10 07:58:44.429 4469-4469/projects.test.com.webviewtest I/dalvikvm: Could not find method android.widget.PopupWindow.showAsDropDown, referenced from method android.support.v7.widget.AppCompatPopupWindow.showAsDropDown
12-10 07:58:44.429 4469-4469/projects.test.com.webviewtest W/dalvikvm: VFY: unable to resolve virtual method 18641: Landroid/widget/PopupWindow;.showAsDropDown (Landroid/view/View;III)V
12-10 07:58:44.429 4469-4469/projects.test.com.webviewtest D/dalvikvm: VFY: replacing opcode 0x6f at 0x000d
12-10 07:58:44.459 4469-4469/projects.test.com.webviewtest I/dalvikvm: Could not find method android.widget.CompoundButton.drawableHotspotChanged, referenced from method android.support.v7.widget.SwitchCompat.drawableHotspotChanged
12-10 07:58:44.459 4469-4469/projects.test.com.webviewtest W/dalvikvm: VFY: unable to resolve virtual method 18333: Landroid/widget/CompoundButton;.drawableHotspotChanged (FF)V
12-10 07:58:44.459 4469-4469/projects.test.com.webviewtest D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006
12-10 07:58:44.559 4469-4469/projects.test.com.webviewtest E/dalvikvm: Could not find class 'android.widget.ThemedSpinnerAdapter', referenced from method android.support.v7.widget.AppCompatSpinner$DropDownAdapter.<init>
12-10 07:58:44.569 4469-4469/projects.test.com.webviewtest W/dalvikvm: VFY: unable to resolve instanceof 2184 (Landroid/widget/ThemedSpinnerAdapter;) in Landroid/support/v7/widget/AppCompatSpinner$DropDownAdapter;
12-10 07:58:44.569 4469-4469/projects.test.com.webviewtest D/dalvikvm: VFY: replacing opcode 0x20 at 0x0016

Actually I don not get a ANR or Unfortunately your app stopped working, the app silently exits to the Main Activity.

  • Working with Enums in android
  • How to fix “Call requires API level 11” with Android Activity?
  • Cannot create 2.3.3 Intel Atom AVD (userdata.img not found)
  • Optimal WebView Settings for HTML5 Support?
  • What are ZygoteInit calls?
  • Centering bitmap Marker (Google Maps Android API v2)
  • I am not using any heavyweight images in my application, just a page with a four spinners.

    In particular, this line is highlighted in red:

    E/dalvikvm: Could not find class 'android.widget.ThemedSpinnerAdapter', referenced from method android.support.v7.widget.AppCompatSpinner$DropDownAdapter.<init>
    

    However as I am not using eclipse, I am sure I have proper imports using gradle:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.1"
    
        defaultConfig {
            applicationId "projects.test.com.webviewtest"
            minSdkVersion 14
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
        compile 'com.android.support:recyclerview-v7:23.1.1'
    }
    

    Related posts:

    AsyncTask Android - Design Pattern and Return Values
    Why is gcc emmiting code aligned to a 2 byte boundary for the ARM instruction set?
    Accidentally deleted Android layout file
    Start a new activity with no transition animation in android 1.6
    Android ListView child View setEnabled() and setClickable() do nothing
    In iOS do we have something like Gradle Build Flavors on Android
  • How to create a ZIP InputStream in Android without creating a ZIP file first?
  • ActionBarSherlock + ViewPager caching more then just prev/next view
  • How to prevent ActivityUnitTestCase from calling Application.onCreate?
  • Android - zoom in/out RelativeLayout with spread/pinch
  • How to download and save an image in Android
  • Assets - “images”, “sounds”, and “webkit”?
  • 3 Solutions collect form web for “Could not find class 'android.widget.ThemedSpinnerAdapter'”

    In my situation this was resolved by removing the use of android:tint="?attr/colorControlNormal" within the layout XML file… Maybe this helps others.

    I solved the problem looking to the compileSdkVersion in my project.
    I had 4 modules, 3 of them were compiling with the sdk 22, one was compiling with the sdk 23.

    After I changed all of them to the sdk 22, problem solved. So my advice is to check the SDK version and select for all the modules in your project to the same number.

    Cheers

    i also got same issue with spinner,it is running in some devices and not running in some devices. Because i put setAdapter(null). Because of that it is behaving like this. Instead of that put ArrayList arrayList = new ArrayList();
    spinner.setAdapter(new ArrayAdapter<String>(activity.this, android.R.layout.simple_dropdown_item_1line, arrayList));

    then it will be work in all devices.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.