2

我在用,

 Android Studio Version - 3.3.2
 minSdkVersion 19
 targetSdkVersion 27

科特林插件:

 apply plugin: 'kotlin-android'
 apply plugin: 'kotlin-android-extensions'
 apply plugin: 'kotlin-kapt'

kotlin 构建文件:

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

在顶级 build-gradle

ext.kotlin_version = '1.3.21'

classpath 'com.android.tools.build:gradle:3.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.27.1'

我的问题是它给了我很多 Kotlin 编译器警告。

我对此警告没有异议,但我想补充一下,

shrinkResources true
minifyEnabled true 

在我的应用程序中,但由于警告这给了我一个错误来首先解决警告。

请在屏幕截图中查看我的警告数量,如果有任何解决方案,请在此处给出答案。

在此处输入图像描述

编辑

以下是我的 build.gradle 文件

 apply plugin: 'com.android.application'
 apply plugin: 'kotlin-android'
 apply plugin: 'kotlin-android-extensions'
 apply plugin: 'io.fabric'
 apply plugin: 'kotlin-kapt'


 android {
 compileSdkVersion 27
 defaultConfig {
    applicationId "com.myapp"
    minSdkVersion 19
    targetSdkVersion 27
    versionCode 1
    versionName "10.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}

buildTypes {

  release {
        debuggable false
        shrinkResources true
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
    }

    debug {
        debuggable true
        shrinkResources true
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
    }

      compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
      } 

      dexOptions {
      // Prevent OutOfMemory with MultiDex during the build phase
      javaMaxHeapSize "4g"
      }

      dataBinding {
         enabled = true
      }
}

kapt {
     generateStubs = true
}



  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
      implementation 'com.android.support:appcompat-v7:27.1.1'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
      implementation 'com.android.support:design:27.1.1'
      testImplementation 'junit:junit:4.12'
       androidTestImplementation 'com.android.support.test:runner:1.0.2'

       implementation 'com.android.support:multidex:1.0.3'
       implementation 'com.intuit.sdp:sdp-android:1.0.6'
       implementation 'com.facebook.android:facebook-login:4.39.0'
       implementation 'com.amitshekhar.android:rx2-android-networking:1.0.2'

       implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
       implementation 'com.twitter.sdk.android:twitter:3.3.0'
       implementation 'com.google.firebase:firebase-core:16.0.6'
       implementation 'com.google.firebase:firebase-messaging:17.3.4'
       implementation 'com.google.android.gms:play-services-location:16.0.0'
       implementation 'com.google.android.gms:play-services-places:16.0.0'
       implementation 'com.google.android.gms:play-services-base:16.0.1'
       implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'

       implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
       implementation 'com.wang.avi:library:2.1.3'

       implementation 'com.google.android.gms:play-services-maps:16.0.0'
       implementation project(':multipleimageselect')
       implementation 'com.github.bumptech.glide:glide:4.8.0'
// location
       implementation 'com.google.android.gms:play-services-location:16.0.0'
       implementation 'id.zelory:compressor:2.1.0'
       annotationProcessor 'com.android.databinding:compiler:3.1.4'

       implementation project(':library_slider')
       implementation 'de.hdodenhof:circleimageview:3.0.0'

       implementation 'com.jakewharton:butterknife:8.8.1'
       annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
       implementation 'com.flurry.android:analytics:11.5.0@aar'
       implementation 'com.google.android.libraries.places:places:1.0.0'
       implementation 'com.google.code.findbugs:jsr305:3.0.2'
       implementation 'com.braintreepayments.api:braintree:1.7.10'

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

0 回答 0