简体   繁体   English

我是否必须在 AOSP java 中包含来自同一 package 的类?

[英]Do I have to include classes from the same package in AOSP java?

I have a weird behavior in one service I am developing for AOSP.我在为 AOSP 开发的一项服务中有一种奇怪的行为。

It seems like I have to include classes even if they are in the same package, while this is normally not needed in java.似乎我必须包含类,即使它们在同一个 package 中,而在 java 中通常不需要。 If I don't, I get cannot find symbol at compile time.如果我不这样做,我会在编译时cannot find symbol

Is there some special rule applying to AOSP?是否有一些适用于 AOSP 的特殊规则? Maybe some special settings I need to fix in Android.mk?也许我需要在 Android.mk 中修复一些特殊设置?

I bet you have a typo in one of your class's package statements;)我敢打赌,您在班级的 package 声明中有一个错字;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java - 我是否必须在包中包含的所有类中注释包? - Java - Do I have to annotate a package in all classes that are contained by the package? 如果 2 个类有相同的 package 语句怎么办 - What to do if 2 classes have the same package statement 如何从类路径中的 Java 包中读取所有类? - How do I read all classes from a Java package in the classpath? Eclipse + Java:如何从默认包中导入类? - Eclipse + Java: How do I import classes from the default package? 如何从另一个 Package 和 Java 中的文件夹导入类? - How Do I Import Classes From Another Package and Folder in Java? 包含来自同一程序包的接口(Java) - Include an interface from the same package (Java) 同一源代码包中是否可以包含.class和.java类? - is it possible to have .class and .java classes inside the same source code package? 我在不同的jar中有两个具有相同名称和相同包结构的类。 是否可以从jar中专门选择一个类? - I have two classes with same name and same package structure in different jars. Is it possbile to choose a class from jar specifically? 我有一个 Java 问题 - 它没有找到一些 package 或类 - I have a Java Problem - It is not locating some package or classes Same Package java applet中的类 - Classes in Same Package java applet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM