2011-05-19 53 views
2

我試圖在我的應用程序中重新使用PhoneUtils.java~/android_src/packages/apps/ Phone/src/com/android/phone/)並進行了一些自定義設置。android:無法在aidl文件中找到類錯誤的導入com.android.internal.telephony.gsm.NetworkInfo

我已經加入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)) 
+0

我想你應該看到[此帖](http://stackoverflow.com/a/10738095/1432127) – Kostek 2014-04-02 06:54:08

回答

0

在這種情況下,添加以下行framework.aidl。 (平臺\ Android的9 \ framework.aidl)

parcelable com.android.internal.telephony.gsm.NetworkInfo;

相關問題