Android Gradle在尝试集成Sentry时抛出API警告
我正在尝试将Sentry集成到我的应用程序中,用于碰撞监控。我已经一步一步地跟随哨兵文档,但现在我得到以下警告:Android Gradle在尝试集成Sentry时抛出API警告,android,android-gradle-plugin,build.gradle,sentry,Android,Android Gradle Plugin,Build.gradle,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 informatio
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或哨兵文件中找不到任何关于这种性质警告的信息。它直接指向apply plugin
,但根据他们的网站,这也是最新的版本:
build.gradle(模块):
build.gradle(项目):
GitHub上存在与此警告相关的问题: 以及为什么它还没有掉下来: 好的,看来新的API只是在Gradle4.8中添加的 我仍然需要我们的插件为4.4版本的用户工作,所以我认为我们现在必须忽略这个警告,因为人们慢慢地被迫根据Play Store的要求使用更新的Gradle
正如上面所指出的,还有一个问题,它需要更新版本的Gradle,这意味着它会打断使用旧版本的用户。这不是错误,而是警告:)好的。我如何摆脱它?我相信您库的gradle文件正在使用“variantOutput.getProcessManifest()”,它已被替换。你能通过按cntrl+shift+F在你的整个项目中搜索这个吗。没有结果。那么这是在库中使用的,使用刚刚导入的。恐怕你对此无能为力。直到它被更新汉克斯布鲁诺。我想我会忽略这个错误,直到他们决定做点什么。到目前为止,它没有使我的应用程序崩溃,这正是我所关心的。我投了赞成票,接受了你的回答。如果你认为这是一个被问得很好的问题,你能给我一个投票吗?有一个新的评论,fork的作者提到用向后兼容的方式进行修复,并向Java SDK提供PR。这样,警告将永久固定。
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'
}
// 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
}