autofix-java-import
Fixes Java 'cannot find symbol' errors by adding import statements or library dependencies.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Fixes Java 'cannot find symbol' errors by adding import statements or library dependencies.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Comprehensive build error repair tool for C++, Rust, and Java projects using Soong, GN, Make, or CMake. Automatically fixes 30+ types of errors including headers, linking, APIs, and config.
Fixes function call errors with wrong number or type of arguments.
Fixes type mismatch errors by adding appropriate casts or conversions.
Fixes syntax errors in Android.bp files.
Removes unsupported or unknown compiler flags from build configurations.
Fixes scope and variable errors in BUILD.gn files.
| name | autofix-java-import |
| description | Fixes Java 'cannot find symbol' errors by adding import statements or library dependencies. |
Fixes Java compilation errors related to missing classes or packages.
error: cannot find symbol + symbol: class Xerror: package X does not existerror: cannot access XExtract class name or package from error message.
| Class | Import | Library (Android.bp) |
|---|---|---|
RecyclerView | androidx.recyclerview.widget.RecyclerView | androidx.recyclerview_recyclerview |
LiveData | androidx.lifecycle.LiveData | androidx.lifecycle_lifecycle-livedata |
Gson | com.google.gson.Gson | gson |
Log | android.util.Log | (built-in) |
Bundle | android.os.Bundle | (built-in) |
Insert after the package declaration:
package com.example.myapp;
import androidx.recyclerview.widget.RecyclerView; // ADD THIS
public class MainActivity {
In Android.bp:
static_libs: [
"androidx.recyclerview_recyclerview",
],
In build.gradle:
implementation 'androidx.recyclerview:recyclerview:1.2.1'