0

I recently installed an update of android studio v 3.1.4 and I am trynig to design some Layout for my app . But the previous does not showing the result of my Xml code . When i synchronize the project it run succefully ..where is the matter ?

i tried many time to fix this problem by changing some dependencies to make it work
such as 'com.android.support:appcompat-v7:28.0.0-alpha3' : by other version but still always not showing the previous . i also tried to clean and rebuild the project .

enter image description here

> Here some files   
> 
> > main_activity.xml
> > 
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <android.support.v4.widget.DrawerLayout
> > > xmlns:android="http://schemas.android.com/apk/res/android"
> > >     xmlns:app="http://schemas.android.com/apk/res-auto"
> > >     xmlns:tools="http://schemas.android.com/tools"
> > >     android:layout_width="match_parent"
> > >     android:layout_height="match_parent"
> > >     tools:context=".MainActivity">
> > > 
> > > 
> > > <RelativeLayout
> > >     android:id="@+id/rel"
> > >     android:layout_width="match_parent"
> > >     android:layout_height="match_parent">
> > 
> >     <FrameLayout
> >         android:id="@+id/main_container"
> >         android:layout_width="match_parent"
> >         android:layout_height="match_parent"
> >         android:layout_alignParentLeft="true"
> >         android:layout_alignParentStart="true"
> >         android:layout_alignParentTop="true">
> > 
> >         <android.support.v7.widget.RecyclerView
> >             android:id="@+id/all_users"
> >             android:layout_width="match_parent"
> >             android:layout_height="match_parent">
> > 
> >         </android.support.v7.widget.RecyclerView>
> >     </FrameLayout> </RelativeLayout>
> > 
> >     <android.support.design.widget.NavigationView
> >         android:layout_width="wrap_content"
> >         android:layout_height="match_parent"
> >        android:layout_gravity="start"
> >         android:layout_marginBottom="3dp"></android.support.design.widget.NavigationView>
> > 
> > </android.support.v4.widget.DrawerLayout>

APP.GRADLE

    apply plugin: 'com.android.application'
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.chaabane.takwa.myapplication"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
   .................
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'


    implementation 'com.android.support:design:28.0.0-alpha3'
    implementation 'com.android.support:cardview-v7:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
 implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'

**

> PROJECT.BUILD

**

  dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'



        classpath 'com.google.gms:google-services:3.1.1'
    }
}

4 Answers4

1

Try to change in styles.xml this:

<!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->

to this:

<!-- Base application theme. -->
    <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
Bagoly Sz.
  • 156
  • 7
0

I had the same problem and to resolve it you need to temporally downgrade

compileSdkVersion 28 -> 27
targetSdkVersion 28 -> 27

implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' --> 27.1.1
implementation 'com.android.support:design:28.0.0-alpha3' --> 27.1.1
implementation 'com.android.support:cardview-v7:28.0.0-alpha3' --> 27.1.1

I think there is a problem on those library when Android Studio have to render XML layout.

Alternatively, Google released yesterday Android Studio 3.2.0 Upgrade your IDE, change support libraries with 28.0.0 and everything will work

Lorenzo Vincenzi
  • 1,153
  • 1
  • 9
  • 26
  • Maybe there was some other libraries which broke the rendering but upgrading Android Studio is the best solution if you want to support API 28 – Lorenzo Vincenzi Sep 27 '18 at 12:41
0

In style.xml, try add Base.Theme

roger
  • 1
0

go to file option and choose invalidate cache and restart android studio

jay shah
  • 300
  • 1
  • 8