NoClassDefFoundError below SDK 21
I resolved the issue by adding this to my Application Class.
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Seems to be neccessary for android versions prior 5.
android ormlite NoClassDefFoundError on Samsung S4 API 21
I found the way to fix this. It should be a multidex issue. When I reduce the number of dependencies, this problem no longer happens.
In the end I changed
compile 'com.google.android.gms:play-services:10.0.1'
to
compile 'com.google.android.gms:play-services-maps:10.0.1'
as I only need maps and kept all other dependencies.
Still not sure why it behaves like this as clearly API 23 and 24 deals with Multidex in a different way from API 22 and below.
Hope this helps anyone with similar problem.
Failed to install android-sdk: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
I had a similar problem this morning (trying to build for Android using Unity3D). I ended up uninstalling JDK9 and installing Java SE Development Kit 8u144.
brew cask uninstall java
# uninstall java9brew tap homebrew/cask-versions
brew cask install java8
# install java8touch ~/.android/repositories.cfg
# without this file, error will occur on next stepbrew install --cask android-sdk
Android java.lang.NoClassDefFoundError
Did you recently updated your eclipse android plugin (adt r17)? Then the following link might help:
How to fix the classdefnotfounderror with adt-17
Update: One year has passed since the question arose. I will keep the link, because even in 2013 it seem to help some people to solve the problem. But please take care what you are doing, see Erics comment below.
Current ADT-Version is 22, I recommend using the most current version.
java.lang.NoClassDefFoundError: android.support.v4.view.LayoutInflaterCompatHC in Android Studio
It looks like you have enabled multidex, but you are not using the multidex library.
Lollipop (API 21) introduced native support for multidexing, but for previous versions of Android you must use the multidex support library to properly support multidexing.
First, add the dependency to your build.gradle:
compile 'com.android.support:multidex:1.0.0'
Second, you need to enable multidex in your application code. If you are not using a custom Application
class already, you can do so by registering the MultiDexApplication
class in your manifest like so:
<application
...
android:name="android.support.multidex.MultiDexApplication">
...
</application>
If you are using a custom application class, you should enable multidex in attachBaseContext()
like so:
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Source: Building Apps with over 65k Methods
Related Topics
Android Camera: Onactivityresult() Intent Is Null If It Had Extras
Android Studio- Program Type Already Present: Com.Google.Android.Gms.Internal.Measurement.Zzwp
Rotate Zoom Drag Image in Android Imageview
How to Get the Current Dns Servers for Android
How to Get Bluetooth Connected Devices Using Bluetoothheadset API
Swiperefreshlayout + Webview When Scroll Position Is at Top
Android Sax Parser Not Getting Full Text from Between Tags
How to Finish Activity When Starting Other Activity in Android
Add an Array of Buttons to a Gridview in an Android Application
Viewing Excel Files in My Android App
How to Check the Internet Connection Periodically in Whole Application
Status Bar Turns White and Does Not Show Content Behind It
How to Get the Battery Level After Connect to the Ble Device
Delete File from Internal Storage
Convert Existing Project to Library Project in Android Studio
Firebase Authentication State Change Does Not Fire When User Is Disabled or Deleted