构建失败并出现错误:虽然包含依赖项,但找不到符号类SupportSQLiteDatabase

问题描述 投票:0回答:1

在Android应用上工作。该应用程序工作正常,但突然我得到构建失败,有多个'找不到符号类'错误。我很确定我已经在同一个代码上推送了几个构建版本,现在它无法找到类错误。

我已经在gradle文件中包含实现的类中的错误。 (Error:(3, 35) error: cannot find symbol class SupportSQLiteDatabase)(Error:(3, 35) error: cannot find symbol class SupportSQLiteQuery)

尝试将details.useVersion更改为28.0.0,但结果相同。

configurations.all 
{
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '26.0.0'
            }
        }
    }
}

Gradle条目:

android 
{
    compileSdkVersion 28

    //buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.xxx.xxx"
        minSdkVersion 21
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 3
        versionName "1.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

dependencies 
{
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'

//    compile 'com.google.android.gms:play-services:7.8+'
//    Barcode reader requires Version 8.1+ of playservices.
    implementation 'com.google.android.gms:play-services-vision:15.0.2'
//    testCompile 'junit:junit:4.12'

    //Adding dependencies for the ROOM library
    //
    // ViewModel and LiveData
    implementation "android.arch.lifecycle:extensions:1.1.0"
    // alternatively, just ViewModel
    implementation "android.arch.lifecycle:viewmodel:1.1.0"
    // alternatively, just LiveData
    implementation "android.arch.lifecycle:livedata:1.1.0"
    annotationProcessor "android.arch.lifecycle:compiler:1.1.0"
    // Room (use 1.1.0-alpha1 for latest alpha)
    implementation "android.arch.persistence.room:runtime:1.1.1"
    annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
    // Paging
    implementation "android.arch.paging:runtime:1.0.0-alpha5"
    // Test helpers for LiveData
    testImplementation "android.arch.core:core-testing:1.1.0"
    // Test helpers for Room
    testImplementation "android.arch.persistence.room:testing:1.0.0"
    //
    //End ROOM library dependencies
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    //JSON GSON Depedency
    implementation 'com.google.code.gson:gson:2.8.2'

    //Volley Dependency for HTTP(s) requests
    implementation 'com.android.volley:volley:1.1.0'

    //Recycler view and card view
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'

    //ui Template related dependencies
    implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
    implementation 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
    implementation('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.6@aar') {
        transitive = true
    }
    implementation 'com.heinrichreimersoftware:material-intro:1.6.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'

    //Retrofit libraries
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.2.0'

    //Firebase & Google Services
    implementation 'com.google.firebase:firebase-core:16.0.3'

    implementation 'com.google.firebase:firebase-messaging:17.3.2'

    //RxJava libraries
    implementation 'io.reactivex.rxjava2:rxjava:2.0.1'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'

    compile 'com.squareup.okhttp3:logging-interceptor:3.5.0'

    //view injection
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    // for dimension manage
    implementation 'com.intuit.sdp:sdp-android:1.0.5'

    //datepicker
    implementation 'com.github.drawers:SpinnerDatePicker:1.0.6'

    //Dependency for SupportSQLiteDatabase
    implementation 'android.arch.persistence:db:1.1.1'


}
multidex
1个回答
0
投票

我试过无效/重启 - 没有用。删除了库文件并与Gradle同步 - 无效。

将Android Studio升级到3.3.2。二手Kotlin V 1.3。升级Gradle。这删除了'找不到符号类'错误。但是给了我新的错误。由于某些原因,AndroidManifest.xml会抛出以下格式的错误:

    <activity
        android:name=".transactions.xxx.xxx"
        android:screenOrientation="portrait">
    </activity>

但是当相同的代码改为

    <activity
        android:name=".transactions.xxx.xxx"
        android:screenOrientation="portrait"/>

它工作正常。

最后我得到'程序类型已经存在:... ListAdapter'错误,由...解决

Android: Compilation error with v7 support lib 27.1.0 "Program type already present" android.support.v7.recyclerview.extensions.ListAdapter

© www.soinside.com 2019 - 2024. All rights reserved.