java.lang.NoSuchFieldError android/support/v7/AppCompat/
I had a similar problem after upgrading to Android Studio 2.0 and Android Support Library 23.3.0. The error was
java.lang.NoSuchFieldError: No static field AppCompatTheme of type
I solved it by going to Android SDK Manager. Updates were available for following:
- Android SDK Build Tools
- Android SDK Tools
- Android Support Library
- Google Repository
Updated and ran the app again, that solved the problem.
Edit:
If you have already updated above mentioned things and still have problems,
as @mparkes pointed out in comment, check if you have updated the build.gradle(app)
file to use the latest library as following:
dependencies {
compile 'com.android.support:appcompat-v7:23.3.0'
}
Then rebuild the project: Build Menu > Rebuild Project
I also had this problem after upgrading to Android Studio 2.0. In my case it was Instant Run issue. There is a bug in AOSP Issue Tracker.
So disabling Instant Run helped me.
- Open the Settings or Preferences dialog.
- Navigate to Build, Execution, Deployment > Instant Run.
Apparently I needed to update my SDK tools and SDK platform-tools, after that I was able to select 5.1.1 as build target for my appcompat v7 library project.