Rendering issue for Android with Intellij 13.1.3

2019-02-12 16:48发布

问题:

When viewing the preview of the (only) activity in my Android app in IntelliJ 13.1.3 I get the following error:

Rendering Problems This version of the rendering library is more recent than your version of IntelliJ IDEA. Please update IntelliJ IDEA

Any ideas of where I'm going wrong? Here is what I did:

  • Installed IntelliJ 13.1.3 Ultimate edition.
  • Mapped Android SDK.
  • Verified that IntelliJ is pointing to the the correct installation of the Android SDK.
  • Created new Android module using 'Gradle: Android Module'.
  • Verified that module compiled fine.

Note: I have tried build tools version 19, 19.0.1, 19.1 and 20.

My build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
       classpath 'com.android.tools.build:gradle:0.9.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
} 

android {
    compileSdkVersion 19
    buildToolsVersion "19.1"

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
}

回答1:

Check that the API rendering is set lower than 20. This is different from the build SDK.

In the preview window the rendering API icon is an android with a number next to it, in this case it would be the number 20, it's usually the last icon of the first row in the preview window.



回答2:

I had same problem with Intellij 2016. But having no secondary option for API rendering. The problem solved by installing "Tools(Preview Chanel) -> Android SDK Buil-tools" in Android SDK Manager and restarting Intellij.