Android Студия GridLayout не работает. Показывает полностью серый в Design View - PullRequest
0 голосов
/ 16 апреля 2020

Я надеюсь, что кто-то может помочь мне с этим: S

Я работаю над Android Studio 3.6.2 и версия Gradle 5.6.4.

Я просто пытался перетащить и поместите GridLayout в ConstraintLayout. Но по какой-то причине GridLayout отображается полностью серым.

Я прочитал в своем исследовании, что может быть что-то связанное с файлами Gradle. Я прочитал, что мне нужно:

1) implementation 'androidx.gridlayout:gridlayout:1.0.0'

2)

repositories {
        google()
    }

Эти два включены в мои файлы Gradle. Итак, я что-то упустил?

Я загружаю эталонное изображение и некоторый код. Заранее спасибо;)

Представление «Дизайн»

build.gradle (Проект: AndroidSample)

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"
    defaultConfig {
        applicationId "com.aretius.androidsample"
        minSdkVersion 26
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
}

build.gradle (Модуль: приложение)

buildscript {
    ext.kotlin_version = '1.3.61'
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 Ответ

0 голосов
/ 18 апреля 2020

Что ж, я наконец-то решил свою проблему, переустановив Android Studio с последней версией:)

...