redhat-developer / redhat-developer/vscode-java

Android project doesn't include generated files from aidl

Open
#2,855 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

android enhancement Gradle
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

When an Android project has aidl source files, the generated code is not included in source paths.

Environment
  • Operating System: Windows 11
  • JDK version: openjdk 11.0.12 2021-07-20
  • Visual Studio Code version: 1.75.0-insider
  • Java extension version: v1.14.2022122003
Steps To Reproduce
  1. Clone https://github.com/Genymobile/scrcpy
  2. Run ./gradlew assembleDebug, it builds successfully
  3. Open server/src/main/java/com/genymobile/scrcpy/wrappers/ClipboardManager.java
Current Result
The import android.content.IOnPrimaryClipChangedListener cannot be resolved Java(268435846)

log.txt
client.log.txt

Expected Result

No error

Additional Informations

The interface android.content.IOnPrimaryClipChangedListener is generated from server/src/main/aidl/android/content/IOnPrimaryClipChangedListener.aidl to server/build/generated/aidl_source_output_dir/debug/out/android/content/IOnPrimaryClipChangedListener.java

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with server/src/main/aidl/android/content/IOnPrimaryClipChangedListener.aidl and the generated server/build/generated/aidl_source_output_dir/debug/out/android/content/IOnPrimaryClipChangedListener.java path, then inspect how generated source paths are discovered when opening ClipboardManager.java. Reproduce with ./gradlew assembleDebug and verify that the unresolved-import error is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
developer-experience, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.