This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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

 
Master Rancher
Posts: 3260
33
  • 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
Master Rancher
Posts: 3260
33
  • 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!