• Post Reply Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable  RSS feed

 
Rancher
Posts: 2975
32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:336)


I get this error when trying to execute an Android app on a Genymotion VM simulator at API level 25
That class is not directly referenced by my code.  There are classes in the android-support-v7-appcompat.jar that do.
For example:
android/support/v7/graphics/drawable/DrawerArrowDrawable
android/support/v7/widget/Toolbar
android/support/v7/view/ActionBarPolicy

The class is documented in the Android docs:
https://developer.android.com/reference/android/support/v7/appcompat/package-summary.html

Where is the definition of the R class when I execute my app?  I expect the Android system to provide it.
Do I need to provide a jar file in the libs folder that has the R.class?

Note: I am using Eclipse, not Android Studio because AS does not run very well on my older/smaller/slower PC.

I have done lots of searches online and downloaded lots of jar files searching for a solution.  No luck so far.

I have a tool to search jar files for classes and to search a selected class for all the references it makes and report on if the referenced classes are available on its classpath.

The R.java file is created by a development tool.  Was it used to create the R class I'm having problems with?
Did the developer of the android.support.v7.appcompat package use a tool to create the R class?  If so, where is it?
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of Android are you targeting in your project?

The "Landroid" portion of the failed resolution suggests you might be targeting a beta version. Is that so?
 
Adam Wentz
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Adam Wentz wrote:Which version of Android are you targeting in your project?

The "Landroid" portion of the failed resolution suggests you might be targeting a beta version. Is that so?





As you were, L Android was the codename used for Android Lollipop. Apart from that correction, which version of Android are you targeting?
 
Adam Wentz
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, share as much of your code as you can, especially your manifest and layout.
 
Norm Radder
Rancher
Posts: 2975
32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The L prefix for the class name comes from reflection names for items.  See https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getName--

Pete Letkeman has helped me with this problem.   We PM'ed

My current opinion is that trying to set the libraries manually is not working, so I have put the project on hold for a while.

Thanks for trying to help.

PS. This is the code that you posted a link to.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NoClassDefFoundError it comes under java.lang.error, it occurs when
Java can’t find the class at runtime.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!