Gson NoClassDefFoundError after ADT and SDK Tools update to v17
I faced a similar problem today.
This fixed it for me:
- Remove all Android Library projects and external jars from the build path.
- Create a folder named 'libs' in your project.
- Place all external .jars in that folder, the ADT should now place them under 'Android Dependencies'.
- Re-import all your previous Android Library projects the normal way.
The issue is that external jars are not placed in the 'libs' folder by default when using Properties - Java Build Path- Add External Jar, instead they are placed under 'Referenced Libraries' instead of 'Android Dependencies' and this causes the NoClassDefFoundError.
Please, check Dealing with dependencies in Android projects for more details.
- Right click the project, and choose Properties
- Go to Java Build Path-Order and Export.
- Tick 'Android Private Libraries'
- Click Project, Clean