user8379853
user8379853

Reputation:

Getting Rendering issue in Android Studio, Views are not Displaying

This is my gradle , I search over internet many times but i am not getting any solution . I already used many thing to solve but i am not getting eject 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'

Upvotes: 3

Views: 92

Answers (1)

Abhishek Kumar
Abhishek Kumar

Reputation: 1265

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

  1. Each new version of Android provides a new API level and new features.
  2. If you are following someones code and they are using something like extends ActionBarActivity or just extends Activity, that was fine for the SDK API the were using at the time they wrote it.
  3. When you start a new blank activity (or in version24 an empty activity), AND the min API you want to support is less than the current API, Android will create the activity extending AppCompatActivity. Id does this so it can support older API levels.
  4. The theme is tied to the Activity type the Activity extends.

Solutions are :

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

or,

  1. First you have to Sync your project.
  2. Next, go to Build menu, and clic on the Clean Project.
  3. Finally, again, go to Build menu, and clic on the Rebuild option.

Upvotes: 1

Related Questions