phen0menon
phen0menon

Reputation: 2462

App in Android Studio - XML Layout doesn't appear

I have a problem after updating Android Studio version from 2.2.* to 3.0.1. The problem is XML Layout doesn't show in design mode.

API / Device changing didn't solve my problem.

The error message is: Exception raised during rendering: android/text/TextUtils

enter image description here

Details:

java.lang.ClassFormatError: android/text/TextUtils at android.content.res.Configuration.setLayoutDirection(Configuration.java:1779) at android.content.res.Configuration.setLocales(Configuration.java:1725) at android.content.res.ResourcesImpl.calcConfigChanges(ResourcesImpl.java:484) at android.content.res.ResourcesImpl.updateConfiguration(ResourcesImpl.java:365) at android.content.res.ResourcesImpl.(ResourcesImpl.java:161) at android.content.res.Resources_Delegate.initSystem(Resources_Delegate.java:90) at com.android.layoutlib.bridge.android.BridgeContext.initResources(BridgeContext.java:255) at com.android.layoutlib.bridge.impl.RenderAction.setUp(RenderAction.java:242) at com.android.layoutlib.bridge.impl.RenderAction.init(RenderAction.java:134) at com.android.layoutlib.bridge.impl.RenderSessionImpl.init(RenderSessionImpl.java:165) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:382) at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193) at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:547) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:681) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Even if I create clean xml layout, I still get the same error message.
XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

</LinearLayout>

Does anyone face this problem before and what is the solution for this?

Update. I did downgrade to 2.2.2 and everything work now. Thanks for suggesting.

Upvotes: 1

Views: 1598

Answers (2)

Khemraj Sharma
Khemraj Sharma

Reputation: 59004

Once i had this issue, and my issue was resolved when i tried changing theme in xml layout. Also check your theme in android manifest and styles. It can be an theme error.

I am attaching an image for your convenience.

Press on this theme icon and change try other themes.

Upvotes: 1

Pankaj Mundra
Pankaj Mundra

Reputation: 1599

Try below trick:

In Android Studio:

Files -> Invalidate Caches / Restart

Please let me know if this solved your issue.

Upvotes: 1

Related Questions