android:在aidl文件com.android.internal.telephony.gsm.NetworkInfo中找不到类错误的导入

发布于 2024-11-09 02:45:01 字数 2181 浏览 5 评论 0原文

我正在尝试重新使用 PhoneUtils.java (~/android_src/packages/apps/ Phone/src/com/android/phone/)在我的应用程序中进行了一些自定义。

我添加了 INetworkQueryServiceCallback.aidlINetworkQueryService.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/
Phone/src/com/android/phone/
) within my app with some customizations.

I have added INetworkQueryServiceCallback.aidl and
INetworkQueryService.aidl into my app folder (~/android_src/packages/
apps/USSDActivity/src/com/myapp/ussdactivitytest
) however when i am
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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ζ澈沫 2024-11-16 02:45:01

在本例中,添加以下行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;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文