android.mk引入v4包,Android.mk 避开第三方jar包错误

Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

Warning: okio.Okio: can't find referenced class java.nio.file.Files

Warning: okio.Okio: can't find referenced class java.nio.file.Files

Warning: okio.Okio: can't find referenced class java.nio.file.Files

Warning: okio.Okio: can't find referenced class java.nio.file.Path

Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption

Warning: okio.Okio: can't find referenced class java.nio.file.Path

Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption

Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

Warning: okio.Okio: can't find referenced class java.nio.file.Path

Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption

Warning: okio.Okio: can't find referenced class java.nio.file.Path

Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption

Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

Warning: there were 14 unresolved references to classes or interfaces.

You may need to add missing library jars or update their versions.

If your code works fine without the missing classes, you can suppress

the warnings with '-dontwarn' options.

(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)

Error: Please correct the above warnings first.

make: *** [out/target/common/obj/APPS/AndroidOkGo_intermediates/proguard.classes.jar] Error 1

1.设置:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := \

android-support-v4 \

okhttp-3.4.1 \

okio-1.9.0 \

#LOCAL_JNI_SHARED_LIBRARIES := libamapv304 libamapv304ex libtbt libwtbt

LOCAL_SRC_FILES := $(call all-java-files-under, src)

#1.解决jar中不能被引用start

LOCAL_PROGUARD_ENABLED := disabled

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

#1.解决jar中不能被引用end

#2.解决jar中不能被引用start

#和android.mk同目录下,添加文件proguard.cfg,文件内容:(即后面跟随包名,是的只有一行)

#-dontwarn okio.**

#2.解决jar中不能被引用end

LOCAL_CERTIFICATE := platform

LOCAL_PACKAGE_NAME := AndroidOkGo

include $(BUILD_PACKAGE)

include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \

okhttp-3.4.1:libs/okhttp-3.4.1.jar \

okio-1.9.0:libs/okio-1.9.0.jar \

include $(BUILD_MULTI_PREBUILT)

2.mk编译文件不能识别网络lib库

Android.mk文件中添加:

LOCAL_JAVA_LIBRARIES += org.apache.http.legacy

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值