Gradle 在尝试集成 Sentry 时抛出 API 警告
Gradle throwing API warning while trying to integrate 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
}
GitHub 上存在关于此警告的问题:
以及 here's a comment 尚未删除的原因:
OK so it looks like the new API was only added in Gradle 4.8
I need our Plugin to work for people on 4.4 still, so I think we'll have to ignore this warning for now as people are slowly forced to use a newer Gradle by Play Store requirements.
还有一个 second issue where someone posted a fix on his fork. 正如那里指出的那样,它现在需要更新版本的 Gradle 这意味着它会破坏使用旧版本的人。
我正在尝试将 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
}
GitHub 上存在关于此警告的问题:
以及 here's a comment 尚未删除的原因:
OK so it looks like the new API was only added in Gradle 4.8
I need our Plugin to work for people on 4.4 still, so I think we'll have to ignore this warning for now as people are slowly forced to use a newer Gradle by Play Store requirements.
还有一个 second issue where someone posted a fix on his fork. 正如那里指出的那样,它现在需要更新版本的 Gradle 这意味着它会破坏使用旧版本的人。