Preview not showing in Android 3.0 Canary

I started using the latest version of Android Studio 3.0, but I have a problem with Preview. It does not display the Preview in the preview window. Here is what i did

<?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white"> <include android:id="@+id/activePlanCard" layout="@layout/layout_item_activated_plan" /> <TextView android:id="@+id/DashView" android:layout_width="match_parent" android:layout_height="10dp" android:layout_below="@id/activePlanCard" android:background="@drawable/drw_dash_line" /> <TextView android:id="@+id/provideAddress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/DashView" android:layout_margin="10dp" android:text="Provide Address Detail :" /> </RelativeLayout> </ScrollView> </layout> 

Your help in this matter will be greatly appreciated.

Thanks..

Here I've attached preview ScreenShort

+7
android android-studio preview
source share
3 answers

For me this has changed:

In the values ​​of styles.xml (app> res>), in the main theme of the application - add "base" before the parent style.

From:

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

To:

 <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar"> 
+11
source share

Hey, I had the same problem and I solved it like this: in build.gradle (app), edit the following lines as follows:

 compileSdkVersion 25 buildToolsVersion '25.0.0' targetSdkVersion 25 compile 'com.android.support:appcompat-v7:25.3.1' 

Hope this works for you!

0
source share

I built a new project in Studio 3.0, which worked great in xml rendering in the design window. Then I took all the settings related to sdk versions, and compiled the dependencies in the new gradle.build APP file and applied them to the gradle.build APP file in an application that was not rendering. I changed to the following:

 compileSdkVersion 26 targetSdkVersion 26 compile 'com.android.support:appcompat-v7:26.1.0' compile 'com.android.support:design:26.1.0' 

I cleaned and rebuilt the project. At this point, I received the following build error:

Failed to execute: com.android.support:appcompat-v7:26.1.0

Add Google Maven Repository Project and Sync Project

Show in file

Show in the Project Structure dialog box

I added the Maven repository and cleaned and rebuilt the project. After that, the xml handler works!

0
source share

All Articles