0

最初に署名付き APK を作成したところ、いくつかの警告とエラーが表示されました。

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.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:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles$Lookup
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandle
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandle
Warning:retrofit2.Platform$Java8: can't find referenced class java.lang.invoke.MethodHandles$Lookup
Warning:retrofit2.Platform$Java8: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:there were 22 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.

私はそれについて読んで、 myokioを追加して問題を解決しましたが、retrofit2 の問題はまだ残っています。-dontwarn okio.**proguard-rules.pro

私も追加しようとしまし-dontwarn retrofit2.Plataform$Java8.**たが、ビルドが終了しません (16 GB RAM を搭載した I7 で 30 分以上ビルドされています)。

私のbuild.gradleファイル:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'android-apt'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 25
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.sibela.gohelper"
        minSdkVersion 11
        targetSdkVersion 25
        versionCode 1
        versionName "1.0.13"
    }

    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

        }
    }

    buildTypes.each {
        it.buildConfigField 'String', 'MAPS_API_KEY', MapsApiKey
        it.buildConfigField 'String', 'MAPS_GEOCODING_API_KEY', MapsGeocodingApiKey
    }

    dexOptions {
        javaMaxHeapSize "3g"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    apt 'com.jakewharton:butterknife-compiler:8.2.1'
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.jakewharton:butterknife:8.2.1'
    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'com.google.android.gms:play-services-location:10.0.1'
    compile 'com.google.android.gms:play-services-appinvite:10.0.1'
    compile 'com.google.android.gms:play-services-auth:10.0.1'
    compile 'com.takisoft.fix:preference-v7:25.0.1.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true;
    }
}

apply plugin: 'com.google.gms.google-services'

じぶんのproguard-rules.pro

-keepnames class android.widget.ScrollView { *; }
-keepnames class android.widget.AbsListView { *; }
-keepnames class android.support.v4.widget.NestedScrollView { *; }
-keepnames class android.support.v7.widget.RecyclerView { *; }
-keepnames class android.support.v4.view.ViewPager { *; }
-keepnames class android.widget.EdgeEffect { *; }
-keepnames class android.support.v4.widget.EdgeEffectCompat { *; }
-dontwarn okio.**
-dontwarn retrofit2.Plataform$Java8.**

これを修正するにはどうすればよいですか?

4

0 に答える 0