• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Rancher
Posts: 4739
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, share as much of your code as you can, especially your manifest and layout.
 
Norm Radder
Rancher
Posts: 4739
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
NoClassDefFoundError it comes under java.lang.error, it occurs when
Java can’t find the class at runtime.
 
expectation is the root of all heartache - shakespeare. tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic