Fixed to build cleanly in GMS Core environment, where the platform code is not available.
Change-Id: Ie427e37cb6b7df5293fdbd9b65a561dc9d4da659
(cherry picked from commit 1de2f9d7ddb6678573319c90892153b75aec5bce)
diff --git a/Android.mk b/Android.mk
index 17681b2..eac18ef 100644
--- a/Android.mk
+++ b/Android.mk
@@ -39,8 +39,13 @@
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(okhttp_common_src_files)
LOCAL_JAVACFLAGS := -encoding UTF-8
-LOCAL_JAVA_LIBRARIES := core
-LOCAL_NO_STANDARD_LIBRARIES := true
+# This is set when building apps - exclude platform targets.
+ifneq ($(TARGET_BUILD_APPS),)
+ LOCAL_SDK_VERSION := 11
+else
+ LOCAL_JAVA_LIBRARIES := core
+ LOCAL_NO_STANDARD_LIBRARIES := true
+endif
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
include $(BUILD_STATIC_JAVA_LIBRARY)