Exception Raised During Rendering: Unable To Find The Layout For Action Bar
Solution 1:
I had this kind of error. On My Mac, there is API 22. If I choose it this error will appear. So clicking on API 21 or below would solve your problem
You probably need to update your tools
Solution 2:
Those using Eclipse might try to choose Theme.DeviceDefault to eliminate the exception.
Update: as per comments this works for Android Studio also.
Solution 3:
You can solve this problem by two ways
Change API from the tab, Try one of them from the available or Select PICK UP BEST or change your minimum sdk
Change the Theme if first solution not work
Solution 4:
Click on Theme in Editor and change the theme:
MY issue is solved after this
Solution 5:
I had this error on eclipse-3.8, adt-23.07, sdk-tools-23.1, appcompat_v7_r19.1.
After analyzing the error I found the problem is in
android-sdk-linux/platforms/android-23/data/layoutlib.jar:com/android/layoutlib/bridge/impl/Layout.class on method createActionBar
at line if (this.mBuilder.isThemeAppCompat())
My solution:
- (don't have the source, so) decompile Layout.class -> Layout.java
- edit Layout.java, add method:
private boolean hasWindowDecorActionBar(SessionParams params) {
LayoutlibCallback callback = params.getLayoutlibCallback();
try {
callback.findClass("android.support.v7.app.WindowDecorActionBar");
} catch (ClassNotFoundException ei) {
try {
callback.findClass("android.support.v7.internal.app.WindowDecorActionBar");
} catch (ClassNotFoundException e) {
returnfalse;
}
}
returntrue;
}
- Locate the line
if (this.mBuilder.isThemeAppCompat())
then change to :
if (this.mBuilder.isThemeAppCompat() && hasWindowDecorActionBar(params))
- recompile Layout.java -> Layout.class and Layout$Builder.class
- update layoutlib.jar with the new classes
- restart eclipse
That's all. Now, I can render using API-23 all of my old app layouts that links against appcompat_v7_r19.1.
Post a Comment for "Exception Raised During Rendering: Unable To Find The Layout For Action Bar"