android:在aidl文件com.android.internal.telephony.gsm.NetworkInfo中找不到类错误的导入
我正在尝试重新使用 PhoneUtils.java
(~/android_src/packages/apps/ Phone/src/com/android/phone/
)在我的应用程序中进行了一些自定义。
我添加了 INetworkQueryServiceCallback.aidl
和 INetworkQueryService.aidl
进入我的应用程序文件夹(~/android_src/packages/ apps/USSDActivity/src/com/myapp/ussdactivitytest
)但是当我 与 android 源一起构建我收到以下错误:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Aidl: com.myapp.ussdactivity <= packages/apps/USSDActivity/src/com/myapp/ussdactivitytest/INetworkQueryService.aidl
Aidl: com.myapp.ussdactivity <= packages/apps/USSDActivity/src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.aidl
packages/apps/USSDActivity/src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.aidl:19: couldn't find import for class com.android.internal.telephony.gsm.NetworkInfo
make: *** [out/target/common/obj/JAVA_LIBRARIES/com.myapp.ussdactivity_intermediates/src/src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.java] Error 1
Android.mk:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += \
src/com/myapp/ussdactivitytest/EventLogTags.logtags \
src/com/myapp/ussdactivitytest/INetworkQueryService.aidl \
src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.aidl
LOCAL_MODULE := com.myapp.ussdactivity
include $(BUILD_STATIC_JAVA_LIBRARY)
include $(CLEAR_VARS)
LOCAL_STATIC_JAVA_LIBRARIES := com.android.phone.common
LOCAL_JAVA_LIBRARIES := core framework
LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += \
src/com/myapp/ussdactivitytest/EventLogTags.logtags \
src/com/myapp/ussdactivitytest/INetworkQueryService.aidl \
src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.aidl
LOCAL_PACKAGE_NAME := USSDActivity
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)
include $(call all-makefiles-under,$(LOCAL_PATH))
I am trying to re-use PhoneUtils.java
(~/android_src/packages/apps/
) within my app with some customizations.
Phone/src/com/android/phone/
I have added INetworkQueryServiceCallback.aidl
andINetworkQueryService.aidl
into my app folder (~/android_src/packages/
) however when i am
apps/USSDActivity/src/com/myapp/ussdactivitytest
building alongside android source I am getting the following error:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Aidl: com.myapp.ussdactivity <= packages/apps/USSDActivity/src/com/myapp/ussdactivitytest/INetworkQueryService.aidl
Aidl: com.myapp.ussdactivity <= packages/apps/USSDActivity/src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.aidl
packages/apps/USSDActivity/src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.aidl:19: couldn't find import for class com.android.internal.telephony.gsm.NetworkInfo
make: *** [out/target/common/obj/JAVA_LIBRARIES/com.myapp.ussdactivity_intermediates/src/src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.java] Error 1
Android.mk:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += \
src/com/myapp/ussdactivitytest/EventLogTags.logtags \
src/com/myapp/ussdactivitytest/INetworkQueryService.aidl \
src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.aidl
LOCAL_MODULE := com.myapp.ussdactivity
include $(BUILD_STATIC_JAVA_LIBRARY)
include $(CLEAR_VARS)
LOCAL_STATIC_JAVA_LIBRARIES := com.android.phone.common
LOCAL_JAVA_LIBRARIES := core framework
LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += \
src/com/myapp/ussdactivitytest/EventLogTags.logtags \
src/com/myapp/ussdactivitytest/INetworkQueryService.aidl \
src/com/myapp/ussdactivitytest/INetworkQueryServiceCallback.aidl
LOCAL_PACKAGE_NAME := USSDActivity
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)
include $(call all-makefiles-under,$(LOCAL_PATH))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在本例中,添加以下行framework.aidl。 (Platforms\android-9\framework.aidl)
可解析com.android.internal.telephony.gsm.NetworkInfo;
In this case, add the following lines framework.aidl. (Platforms \ android-9 \ framework.aidl)
parcelable com.android.internal.telephony.gsm.NetworkInfo;