I see a lot of posts online, are written half, not specific enough, or do not fit, I tried a lot of myself, finally got the solution.
prerequisite
Android studio 3.5.1 track of
the JDK 1.8 com. The Android. View the build: gradle: 3.5.1 track of migration to the
project androidx strong> p>
step 1: check to see if build.gradle is configured
search build. If there is a keyword in gradle com. Android. Support: support - annotations code>
if not, you need to add configuration, the steps as shown in figure p>
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:support-annotations:28.0.0"
}
modifier error file
view the file with the error and modify the import package.
import android.support.annotation.IntDef;
import android.support.annotation.WorkerThread;
import androidx.annotation.IntDef;
import androidx.annotation.WorkerThread;
shortcut
Ctrl + Shift + R
import android. Support. The annotation. strong>
with
import androidx. The annotation. strong>
synchronization project Sync
Read More:
- Maven compilation error: package does not exist jar package does not exist
- Idea Maven project uses package to package and report error (package does not exist)
- [error log] 27.1.0 series of errors Error:Failed to resolve: com.android.support :support-an notations:27.1.0
- Android project error: could not resolve com.android.support .c onstraint:constraint-layout :2.0.2.
- The MAC compiler Doris reported an error that thrift.annotation does not exist
- android studio:Error inflating class android.support.v4.widget.SwipeRefreshLayout
- Does the version of idea2020.1 import mybayis jar package or report an error? Error: (4,28) Java: package org.apache.ibatis.io does not exist
- Android Studio sync build.gradle appears: Failed to resolve: com.android.support:appcompat problem
- package R does not exist
- [solved] not found android.support .v7. internal.app.WindowDecorActionbar
- package xxx does not exist cannot find symbol
- Idea error: (4, 28) Java: package com.alibaba.fastjson does not exist
- [error record] as compilation error (Android support plugin version is too high | upgrade Android studio to the latest version)
- Idea error: (4, 46) Java: package org.springframework.boot . autoconfigure does not exist problem solving
- About Android studio error: (26,13) failed to resolve: com.android.support : appcompat-v7:27. + error
- Failed to resolve: com.android.support:appcompat-v7:25.3.0
- Error inflating class android.support.v7.widget.SearchView
- [unity] Android package error java.lang.ClassNotFoundException Did not find class com.unity3d . player.MainActivity
- [error record] kotlin code compilation error when Android studio compiles (process @ nonnull parameter when upgrading support library)
- Failed to resolve: com.android.support:appcompat-v7:27.