Cannot resolve symbol Theme из-за gradle

203
06 июля 2018, 21:50

Когда добавляю classpath в первый файл build.gradle

buildscript {
repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:4.0.1' // для FireBase (эту строчку)
    // 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
}

То у меня сразу пропадет Theme и горит красным

<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:windowBackground">@color/colorMainBackground</item>
    <item name="elevation">0dp</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="actionBarStyle">@style/AppTheme.ActionBar</item>
</style>

Тоже самое происходит, если не добавлять этот classpath, а поставить версию gradle на 3.1.3

В чем может быть проблема?

Второй build.gradle

apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.xxx"
    minSdkVersion 19
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    targetCompatibility 1.8
    sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v13:27.1.1'
implementation 'commons-codec:commons-codec:1.11'


implementation 'com.google.firebase:firebase-crash:16.0.0'

implementation 'com.google.firebase:firebase-core:16.0.0'
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'
}
apply plugin: 'com.google.gms.google-services'
Answer 1

Интересно, но помогло удаление папки .idea/libraries, но проблему с версией gradle 3.1.3 не решило. Ошибка осталась, даже удаление не помогает

READ ALSO
Java. Сборка war gradle

Java. Сборка war gradle

Начал изучать систему сборки gradleНаписал приложение с использованием websocket(Sockjs)

222
Библиотека json simple. JSONArray to List&lt;String&gt;. Stream API

Библиотека json simple. JSONArray to List<String>. Stream API

У меня есть json строка, которая представляется собой массив

182
Собрать видеоряд из изображений Java

Собрать видеоряд из изображений Java

Средствами opencv я разбил видео на изображения(png), а теперь хочу собрать обратно(включая аудиоряд), но не знаю как

184
Как запустить Wildfly с нужным мне IP?

Как запустить Wildfly с нужным мне IP?

Intellij IDEA по дефолту запускает сервер по адресу 1270

161