Getting rendering issue in Android Studio, views not showing

This is my gradle, I browse the internet many times but I am not getting any solution. I have already used a lot for the solution, but I am not getting an answer to my question, please help me.

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
dataBinding { enabled = true }

defaultConfig {
    applicationId "com.android.application"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'
    }

}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}
dependencies {
testCompile 'junit:junit:4.12'
compile 'cz.msebera.android:httpclient:4.4.1.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.+'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile(name: "truesdk-0.5", ext: "aar")
}
apply plugin: 'com.google.gms.google-services'

      

+3


source to share


1 answer


I faced the same problem. Actually this problem comes from style.xml

  • Each new version of Android provides a new API level and new features.
  • If you follow someones code and use something like extends ActionBarActivity, or just extend Activity, that was fine for the SDK API that was in use at the time they wrote it.
  • When you start a new empty activity (or in version 24 - empty activity) AND the minimum API you want to support is less than the current API, Android will create an activity that extends AppCompatActivity. Id do this to support older API levels.
  • A topic is tied to the type of activity that is ongoing.

Solutions:



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

      

or,

  • You must sync your project first.
  • Then go to the Build menu and click on Clean Project.
  • Finally, go to the Build menu again and click Rebuild.
+1


source







All Articles