Back to list
hyz0906

autofix-java-import

by hyz0906

0🍴 0📅 Jan 19, 2026

SKILL.md


name: autofix-java-import description: Fixes Java 'cannot find symbol' errors by adding import statements or library dependencies.

Java Import Skill

Fixes Java compilation errors related to missing classes or packages.

Detection Patterns

  • error: cannot find symbol + symbol: class X
  • error: package X does not exist
  • error: cannot access X

Strategy

  1. Extract Symbol: Get the missing class or package name.
  2. Find Package: Determine the full qualified name.
  3. Add Import: Insert import statement after package declaration.
  4. Add Dependency (if needed): Update build file with library.

Instructions

Step 1: Parse the Error

Extract class name or package from error message.

Step 2: Common Android/Java Mappings

ClassImportLibrary (Android.bp)
RecyclerViewandroidx.recyclerview.widget.RecyclerViewandroidx.recyclerview_recyclerview
LiveDataandroidx.lifecycle.LiveDataandroidx.lifecycle_lifecycle-livedata
Gsoncom.google.gson.Gsongson
Logandroid.util.Log(built-in)
Bundleandroid.os.Bundle(built-in)

Step 3: Add Import Statement

Insert after the package declaration:

package com.example.myapp;

import androidx.recyclerview.widget.RecyclerView;  // ADD THIS

public class MainActivity {

Step 4: Add Dependency (if external library)

In Android.bp:

static_libs: [
    "androidx.recyclerview_recyclerview",
],

In build.gradle:

implementation 'androidx.recyclerview:recyclerview:1.2.1'

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon