I know this might be a trival question for normal Java or Android app that uses Gradle as build system, but in AOSP where Soong is used, it seems there are some special rules in the build system preventing me from doing it the normal way:
I have two Java packages com.consumer
and net.producer
, their source files are under src
fodler, e.g.
src/com/comsumer/A.java
src/net/producer/B.java
In A.java
, it has import net.producer.*
, this compiles OK with javac, but when I tried to do this in AOSP, the build process always complains “package net.producer does not exist”. My Android.bp file looks like this. Did I miss something here?
android_app {
name: "helloapp",
platform_apis: true,
srcs: [
"src/com/consumer/A.java",
"src/net/producer/B.java",
],
dex_preopt: {
enabled: false,
},
visibility: ["//visibility:public"],
certificate: "platform",
}