When creating a new project in Android Studio while using the latest updates and after adding compile com.android.support:appcompat-v7:22.1.0
to the dependencies still have this issue (which is solved if I'm using API 21
):
Exception Details java.lang.NoSuchFieldError: View_theme at android.support.v7.internal.widget.ViewUtils.themifyContext(ViewUtils.java:124) at android.support.v7.widget.Toolbar.(Toolbar.java:198) at android.support.v7.widget.Toolbar.(Toolbar.java:192) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:782) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at com.android.layoutlib.bridge.bars.BridgeActionBar.(BridgeActionBar.java:84) at com.android.layoutlib.bridge.bars.AppCompatActionBar.(AppCompatActionBar.java:56)
When i opened projects that was originally created with eclipse the rendering for API 22
worked great on Android Studio .
Can someone please explain this ?
Another issue that i encountered is that when upgrading the SDK it adds the Android M API and it called API 22 just as Android 5.1.1 which can also cause rendering issues . The solution is just to switch back to API 22 5.1.1 Hope it helps .