如何解决D8警告:D8:找不到类型`org.conscrypt.Conscrypt`

时间:2018-04-17 14:35:21

标签: okhttp3

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

    <title>House of Talents</title>
<style type="text/css">

img     {display: inline-block}

.floatRight {float:right;}
.floatLeft      {float:none;}

.mobileShow {display: none}

.MPED_ULSortable {margin: 0 !important;padding: 0 !important;}

.cornerAll {border-radius: 0px;}

@media only screen and (max-device-width: 850px), (max-width: 850px) {
        .logo {width: 180px;height: auto;}
        .marginBottom {
                margin-bottom: 15px;
        }
        .contentTable {
                width:100% !important;
                float: none !important;
        }
        td[class="floatLeft"] {
                float:left !important;
                width: 100% !important;
        }
        td[class="floatRight"] {
                width: 100% !important;
                float:right !important;
        }
        .mobileHide {display:none}
        .mobileShow {display: block !important}
        
        .resizeImage img {
                width: 100%;
                height: auto;
        }
}
</style>
  </head>

  

    <table cellspacing="0" cellpadding="0" width="100%">
      <tbody>
        <tr>
          <td class="MPED_CONTENT">
            <div class="MPED_CONTENTBLOCK">
              <table border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
                <tbody>
                  <tr>
                    <td align="center">
                      <table border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                          <tr>
                            <td style="width: 850px; max-width: 850px;">
                              <table border="0" cellspacing="0" cellpadding="0">
                                <tbody>
                                  <tr>
                                    <td class="resizeImage" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #243e55; font-weight: bold; background-color: #f3716d; width: 425px; padding-left: 60px;" width="425"><br>
                                    <br>
                                     <img src="http://images.m9.mailplus.nl/user3900328/765/arcq_wit_4x.png" border="0" width="150" height="37" mpdatacustomsize="true"><br>
                                    <br>
                                     <span style="color: #e94b5a; font-family: helvetica;">&nbsp;<br>
                                    </span></td>

                                    <td class="resizeImage" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #243e55; font-weight: bold; background-color: #f3716d; width: 425px;" width="425">&nbsp;</td>
                                  </tr>

                                  <tr>
                                    <td style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #43565e;">
                                      <blockquote>
                                        <p class="p1">&nbsp;</p>
                                      </blockquote>
                                    </td>

                                    <td style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #43565e;">
                                      <p class="p1"><span style="font-family: helvetica;"><img src="http://images.m9.mailplus.nl/user3900328/131/welcome0.png" border="0" width="425" height="425" mpdatacustomsize="true" ><br>
                                      </span></p>
                                    </td>
                                  </tr>

                                  <tr>
                                    <td style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #43565e; line-height: 18px; background-color: #e7f0f7;">&nbsp;</td>

                                    <td style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #43565e; line-height: 18px; background-color: #e7f0f7;">&nbsp;</td>
                                  </tr>
                                </tbody>
                              </table>
                            </td>
                          </tr>
                        </tbody>
                      </table>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
  </body>
</html>

4 个答案:

答案 0 :(得分:3)

我能够通过添加以下内容解决问题:

-dontwarn okhttp3.internal.platform.ConscryptPlatform

proguard-rules.pro文件。

答案 1 :(得分:0)

根据https://github.com/square/okhttp/issues/3922,可以安全地忽略这些警告。

如果构建没有成功,我想还有另一个问题。

答案 2 :(得分:0)

可能https://github.com/square/okhttp/issues/4604会有所帮助,但我没有尝试。

buildscript {
    ...
    repositories {
        ...
        maven {
            url 'http://storage.googleapis.com/r8-releases/raw'
        }
    }

    dependencies {
        classpath 'com.android.tools:r8:1.4.57'  // Must be before the Gradle Plugin for Android.
        classpath 'com.android.tools.build:gradle:3.3.1'  // You don't need to upgrade this to use a newer R8 version.
        ...
     }
}

在我的情况下,我添加了OkHttp库,这是Proguard规则。然后删除了库,但忘记删除规则。如果您从proguard-rules.pro中删除了OkHttp,则可以从build.gradle中注释或删除这些行:

### OkHttp.

# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**

# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*

# OkHttp platform used only on JVM and when Conscrypt dependency is available.
-dontwarn okhttp3.internal.platform.ConscryptPlatform

答案 3 :(得分:0)

./ gradlew组装

  

R8是新的Android代码收缩器。如果您遇到任何问题,   请使用'Shrinker在https://issuetracker.google.com提交错误   (R8)'作为组件名称。您可以通过更新禁用R8   具有'android.enableR8 = false'的gradle.properties。当前版本是:   1.4.94(从go / r8bot(luci-r8-ci-archive-0-5g74)构建390954928f0db9c3b888a367f7f128ce3bbfb160)。