尝试集成Sentry时Gradle抛出API警告

时间:2019-05-08 04:49:36

标签: android android-gradle build.gradle sentry

我正在尝试将Sentry集成到我的应用中以进行崩溃监控。我已逐步跟踪Sentry文档,但现在收到以下警告:

WARNING: API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessManifest(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app

这是由于我对gradle文件所做的更改。我在SO或Sentry文档上找不到有关这种警告的任何信息。它直接指向apply plugin,但根据他们的网站,即使是最新版本:

build.gradle(模块):

apply plugin: 'com.android.application'
apply plugin: 'io.sentry.android.gradle'

android {

    compileSdkVersion 28
    defaultConfig {
        applicationId "com.ozbek.onur.memegenerator"
        minSdkVersion 26
        targetSdkVersion 28
        versionCode 6
        versionName "6.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            multiDexEnabled true
        }
    }
}

dependencies {
    ...
    implementation 'io.sentry:sentry-android:1.7.16'
    implementation 'org.slf4j:slf4j-nop:1.7.25'
}

build.gradle(项目):

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

buildscript {
    dependencies {
        classpath 'io.sentry:sentry-android-gradle-plugin:1.7.16'
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:1)

关于此警告,GitHub上存在一个问题:

还有here's a comment为什么还没有删除它:

  

好的,所以看起来新的API仅在Gradle 4.8中添加了

     

我仍然需要我们的插件才能在4.4版上为人们使用,所以我认为我们暂时必须忽略此警告,因为人们逐渐被Play商店要求强制使用更新的Gradle。

这里也指出了一个second issue where someone posted a fix on his fork.,它需要现在较新的Gradle版本,这意味着它将破坏使用较旧版本的人们。