Android Gradle 部署
添加插件
-
在 project 级别的 build.gradle 文件中添加以下内容。
buildscript {
ext.tingyun_sdk_version = '2.17.5'//基调听云SDK版本
ext.tingyun_ndk_version = '2.0.8'//基调听云NDK版本
repositories {
maven { url "https://nexus2.tingyun.com/nexus/content/repositories/snapshots/" }
}
dependencies {
classpath "com.networkbench:tingyun-ea-agent-android-gradle-plugin:$tingyun_sdk_version"
}
}
allprojects {
repositories {
maven { url "https://nexus2.tingyun.com/nexus/content/repositories/snapshots/" }
}
} -
在 App 级别的 build.gradle 文件中添加以下内容。
apply plugin:'newlens'// 放在 apply plugin: 'com.android.application' 下面
dependencies {
implementation "com.networkbench:tingyun-ea-agent-android:$tingyun_sdk_version"
implementation "com.networkbench.newlens.agent.android2:nbs.newlens.nativecrash:$tingyun_ndk_version"// 采集native carsh 需集成此包
implementation "com.networkbench:nbs.newlens.android.log:1.0.1" // 日志回捞需集成此包
// 采集 OOM 数据需要 kotlin-gradle-plugin 插件 1.3+ ,并依赖 androidx.core:core-ktx、androidx.appcompat:appcompat、androidx.lifecycle:lifecycle-process、com.squareup.okio:okio 等库
implementation "com.networkbench:tingyun-javaleak:1.0.2" // 采集 OOM 需集成此包
implementation "org.bouncycastle:bcprov-jdk15to18:1.69"// 启用国密加密需集成此包
implementation "org.bouncycastle:bcpkix-jdk15to18:1.69"// 启用国密加密需集成此包
}