解决编译Android 4.1.2 Error 41错误

2018阿里云全部产品优惠券(好东东,强烈推荐)
领取地址 https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=82lei0yp

推荐:android 编译源码 错误解决2

[在编译Android代码的时候,出现了 target thumb C++: libwebcore <= out/target/product/generic/obj/SHARED_LIBRARIES/libwebcore_intermediates/WebCore/XMLNames.cpp

2.3/3.0/3.1/3.2/4.0,  4.2都能编译通过就是4.1.2编译不通过,憋屈吗? 编译时的错误信息如下: external/guava/guava/src/com/google/common/collect/Maps.java:542: incompatible types; no instance(s) of type variable(s) K,V exist so that java.util.TreeMap<K,V> conforms to java.util.SortedMap<K,V> found   : <K,V>java.util.TreeMap<K,V> required: java.util.SortedMap<K,V>     SortedMap<K, V> onlyOnLeft = Maps.newTreeMap(comparator);                                                 ^ external/guava/guava/src/com/google/common/collect/Maps.java:543: incompatible types; no instance(s) of type variable(s) K,V exist so that java.util.TreeMap<K,V> conforms to java.util.SortedMap<K,V> found   : <K,V>java.util.TreeMap<K,V> required: java.util.SortedMap<K,V>     SortedMap<K, V> onlyOnRight = Maps.newTreeMap(comparator);                                                  ^ external/guava/guava/src/com/google/common/collect/Maps.java:545: incompatible types; no instance(s) of type variable(s) K,V exist so that java.util.TreeMap<K,V> conforms to java.util.SortedMap<K,V> found   : <K,V>java.util.TreeMap<K,V> required: java.util.SortedMap<K,V>     SortedMap<K, V> onBoth = Maps.newTreeMap(comparator);                                             ^ external/guava/guava/src/com/google/common/collect/Maps.java:547: incompatible types; no instance(s) of type variable(s) K,V exist so that java.util.TreeMap<K,V> conforms to java.util.SortedMap<K,com.google.common.collect.MapDifference.ValueDifference<V>> found   : <K,V>java.util.TreeMap<K,V> required: java.util.SortedMap<K,com.google.common.collect.MapDifference.ValueDifference<V>>         Maps.newTreeMap(comparator);                        ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 4 errors make: *** [out/host/common/obj/JAVA_LIBRARIES/guavalib_intermediates/javalib.jar] Error 41 编译环境: Ubuntu 11.10 java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode) 解决方法:  /home/melord/codebase/4.1.2/external/guava/guava/src/com/google/common/collect/Maps.java



Line 228 :public static <C, K extends C, V> TreeMap<K, V> newTreeMap(

Line 229      @Nullable Comparator<C> comparator) {

注释掉,换成

    public static <K, V> TreeMap<K, V> newTreeMap(

        @Nullable Comparator<? super K> comparator) {
参考: https://groups.google.com/forum/?fromgroups=#!topic/android-building/BFr5bmQzhHw https://github.com/CyanogenMod/android_external_guava/commit/c8b97210aa31c9b80b5fd136d8617ebe4e731e09

推荐:android 编译源码 错误解决

[Ubuntu9.10默认安装的纯净系统,没装任何其他软件。   1.下载源码android-2.1_r2,直接make   2.出错及解决如下:   (1)/bin/bash: bison: command not found

相关推荐