I: problem description
I got an Android project in 2018. The error message of a java file in the project is as follows
import android.support.annotation.NonNull
The exception occurred when introducing Android support, because most Android projects now use Android x to replace the past Android support library, but it depends on the demand. Let’s talk about how to solve this problem on older Android projects.
II: solution
Copy the following line of code to replace the error code
import androidx.annotation.NonNull;
Read More:
- [Solved] Android Project error: import android.support.v4 (V7). App.activitycompat
- [Solved] Android Studio Start Error: Missing essential plugin: org.jetbrains.android Please reinstall Android
- [Solved] error: package android.support.design.widget does not exist
- How to Solve Error inflating class android.support.design.widget.FloatingActionButton
- [Solved] Android9.0 App Install Android4.4 Error: InflateException-You must supply a layout_height attribute.
- [Solved] Android 9.0 APP Install Android 4.4 Error: IllegalArgumentException
- Android uses the Android iconics font library error [How to Solve]
- The SDK of Android webrtc compiled with Ninja – C out / release command reported an error, and the Android NDK processing method could not be found
- Android Error: Android resource linking failed [How to Solve]
- [Solved] Windows Android Studio Cannot Start Error: Internal error. Please refer to https://code.google.com/p/android/issue
- JZVideo Error: Attempt to invoke virtual method ‘android.view.Window android.app.Activity.getWindow()’ on a null object reference
- [Solved] Appium Install Error: Original error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variab
- Android 10 open file exception open failed: eacces (permission denied) android:requestLegacyExternalStorage= “true“
- Android Error: Failure [INSTALL_FAILED_USER_RESTRICTED: Invalid apk] in android
- [Solved] Android-android studio apk Install Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
- [Solved] Android app development version update failed, Android – error: task execution failed ‘: app: com
- Android studio version 3.0 import version 2.2.2 error Error:This Gradle plugin requires Studio 3.0 minimum
- [Solved] :app:processDebugResources Android resource linking failed Android resource linking failed
- [Solved] AAPT: error: resource android:attr/lStar not found