我最近安装了 android studio v 3.1.4 的更新,我正在尝试为我的应用程序设计一些布局。但是前面没有显示我的 Xml 代码的结果。当我同步项目时,它成功运行..问题出在哪里?
我尝试了很多次通过更改一些依赖项以使其工作来解决这个问题,
例如'com.android.support:appcompat-v7:28.0.0-alpha3':通过其他版本但仍然始终不显示以前的版本。我还尝试清理和重建项目。
> 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'
**
> 项目建设
**
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.1.1'
}
}