0

I started a project in android studio 3.1.3 and when I want to design something in the activity design palette, there is a problem! figure below: render errors

This is my gradle(Module: app) code:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.mohammad.myapplication"
        minSdkVersion 14
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:design:28.0.0-alpha3'
    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'
}

I thought maybe this could help: In my Sdk folder, in build-tools folder, there is two folders 28.0.1 & 27.0.3

Update:

I tried these and got nothing:

  • invalidate caches/restart
  • changing alpha3 to alpha1
  • running on an emulator (there were no errors, it's working well)
Mohammad Jafari
  • 1,348
  • 10
  • 14
  • Have you tried a clean/build project? Also, have you tried running it on the emulator and were there any errors? And have you updated Android Studio recently? I had this problem once before and fixed it by navigating to file -> invalidate caches/restart, but this problem could be any number of things. – J. Jefferson Jul 16 '18 at 17:43
  • Yes, I tried all things you said - There were no errors when I run project and it works well, But it shows nothing in design page! – Mohammad Jafari Jul 16 '18 at 17:52
  • try dropping back to _ compileSdkVersion28_ to `27` and also make sure to reflect this change in _'com.android.support:appcompat-v7:28.0.0-alpha3'_ to 27 and anything else that uses it. invalidate cache and restart. – EvOlaNdLuPiZ Jul 16 '18 at 19:43
  • Do not use alpha version! – Roberto Manfreda Aug 05 '18 at 00:12
  • @RobertoManfreda So what should it be instead of alpha3? I tried alpha1, it doesn't change anything! – Mohammad Jafari Aug 05 '18 at 05:05
  • Switch your sdk version to 27 and all relative implementation to 27.x.x. Use this [link](https://dl.google.com/dl/android/maven2/index.html) to check the dependencies that you can use! Use sdk 28 when it will be stable and in a non alpha version! – Roberto Manfreda Aug 06 '18 at 08:33
  • Anyway this isn't a problem related to the sdk build. Please refer to this stackoverflow [link](https://stackoverflow.com/questions/49292487/failed-to-find-style-coordinatorlayoutstyle-in-current-theme) – Roberto Manfreda Aug 06 '18 at 08:42

1 Answers1

0

Change implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' to implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'

T.Aloufi
  • 39
  • 1
  • 11