If the API is set to 28, it becomes "Cannot resolve symbol 'NotificationCompat' and cannot be built.

Asked 2 months ago, Updated 2 months ago, 1 views

After changing the Target version to 28,

ERROR: Symbol not found Symbol: Class NotificationCompat Location: Package android.support.v4.app

I can no longer build next door.

android{

US>lintOptions{
    checkReleaseBuilds false
    abortOnError false
}

    compileSdkVersion28
    defaultConfig {
        applicationId "xxxx"
        minSdkVersion19
        buildToolsVersion '28.0.3'
        targetSdkVersion28
        versionCode xx
        versionName "xxx"

        compileOptions{
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }
dependencies {
implementation'com.android.support:appcompat-v7:28.0.0'
implementation fileTree (include: ['*.jar'], dir: 'libs')
implementation'com.android.support:appcompat-v7:28.0.0'
implementation'com.android.support:customtabs:28.0.0'
implementation'com.android.support:animated-vector-drawable:28.0.0'
implementation'com.android.support:support-vector-drawable:28.0.0'
implementation'com.android.support:support-media-compat:28.0.0'
implementation'com.android.support:support-v4:28.0.0'
implementation'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation'com.android.support.test:runner:1.0.2'
androidTestImplementation'com.android.support.test.espreso:espresso-core: 3.0.2'
implementation'com.android.support:percent:28.0.0'
implementation'com.google.android.gms:play-services-ads:18.1.1'
}

android java

2022-09-30 11:10

1 Answers

The version of Android that supports API level 28 is 9.0 (code name: Pie), so
android.support.v9.app
I think it will be solved by using .

Android.support.v4.app is an older version from just over five years ago and is no longer supported.
Of course, it does not support Pie released last August.


2022-09-30 11:10

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.