Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Java.Lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$drawable;

FotalFotal Member ✭✭✭

Hi, when starting the application, when it was already compiled, an exception occurs: Java.Lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$drawable. As I understand it, R$drawble means a style folder in which there are 4 styles, but their change did not lead to anything or I did not do it right?

These are the styles:

1.
    <selector xmlns:android="...">
        <item android:state_enabled="true" android:state_pressed="false">
            <shape android:shape="oval">
                <solid android:color="#00c853"/>
            </shape>
        </item>
        <item android:state_enabled="false">
            <shape android:shape="oval">
                <solid android:color="#bdf1d2"/>
            </shape>
        </item>
        <item android:state_pressed="true">
            <shape android:shape="oval">
                <solid android:color="#02903d"/>
            </shape>
        </item>
    </selector>
2.
    <shape xmlns:android="..."
    android:innerRadiusRatio="1"
  android:shape="rectangle" >

  <solid android:color="#d0ffffff" />
  <corners android:radius="8dp" />
  <stroke
        android:width="2dp"
        android:color="@color/white"/>
  <padding
          android:left="10dp"
          android:top="10dp"
          android:right="10dp"
          android:bottom="10dp" />
</shape>

3.
    <shape xmlns:android="...">
          <solid android:color="#D3D3D3" />
    </shape>    
4.
    <shape xmlns:android="..."
           android:shape="rectangle" >  
      <stroke
        android:width="2dp"
        android:color="#C6C6C6" />  
    </shape>    

Target build android version is that Nougat 7.1
android:targetSdkVersion="25"

Answers

  • Ahsan_SiddiqueAhsan_Siddique PKMember ✭✭✭✭

    You need to upgrade your android version because AppCompat version is upgraded and now targeting 8.0 android version.

  • FotalFotal Member ✭✭✭

    Change the target version or update firmware android?

  • BenoistLUGNIERBenoistLUGNIER FRMember ✭✭

    Juste upgrade the compile using android version (droid projet properties -> Application)
    I just upgrade from 6.0 to 8.0 and it compile and run fine

  • NickKovalskyNickKovalsky USMember ✭✭✭

    Just created a new project from vs template, copied everything there and then it worked.. 100 000 other solutions didn't work.

  • zerokewl88zerokewl88 Member ✭✭

    @Fotal said:
    Thanks, but I already solved my problem it was due to another error

    Hi, i'm glad you solved your issue and moved on. But i'm also finding this exact same issue after following the same steps you have mentioned above - could you please be so kind if you can remember, how did you resolve this?

    I am receiving what i think is a similar error message after Creating a Binding Library, adding a JAR, and then setting the resource type to EmbeddedJar and building it + referencing it from a Xamarin Droid project.

    e = {Java.Lang.ExceptionInInitializerError: Exception of type 'Java.Lang.ExceptionInInitializerError' was thrown. ---> Java.Lang.NoClassDefFoundError: Failed resolution of: Lcom/techcompany/lang/NTypes; ---> Java.Lang.ClassNotFoundException: Didn't find class "com...

Sign In or Register to comment.