1

начал изучать разработку приложений под Android, и столкнулся со следующей проблемой: при добавлении тех же кнопок/текста на макет ничего не происходит А также выбивает ошибку

Failed to load AppCompat ActionBar with unknown error.

Погуглил, говорят, что проблема может быть в версии implementation, но конкретно для моей версии ответа не нашел. Вот то, что в файле app:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.asus.myapplication"
        minSdkVersion 22
        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-rc01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    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'
}
5

1 ответ 1

3

В res/values/styles.xml замените:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

на:

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.