android - 带有 Tealium AdIdentifier 插件的 Cordova 应用程序在 Android 设备上启动时崩溃
问题描述
按照https://docs.tealium.com/platforms/cordova/install/和https://docs.tealium.com/platforms/cordova/module-adid/上的安装说明,我的应用程序在启动时崩溃。
错误信息是:
com.tealium.adidentifier.AdIdentifier$1.run
java.lang.ClassNotFoundException: Didn't find class
"com.google.android.gms.ads.identifier.AdvertisingIdClient" on path:
DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file
"/data/app/tv.talpa.vi.nld.test-
2s3C4hjESlp1c4kXXrJEoA==/base.apk"],nativeLibraryDirectories=
[/data/app/tv.talpa.vi.nld.test-2s3C4hjESlp1c4kXXrJEoA==/lib/arm64, /system/lib64,
/vendor/lib64]]
使用 Cordova Android 8.0.0。
知道这里出了什么问题吗?
解决方案
通过强制在 Gradle 构建配置中添加 Google Play 服务来解决此问题:
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
}
resolutionStrategy {
force 'com.google.android.gms:play-services-gcm:16.1.0'
}
}
还用 Tealium 标记了这个: https ://github.com/Tealium/cordova-plugin/issues/37#issuecomment-508789280
推荐阅读
- github - 更改项目描述后 GitHub 拉取?
- mongodb - ValidationError: user: Cast to Embedded 值“[]”失败
- sql-server - 从 XML 变量中读取非拉丁字符并插入到表中
- reactjs - React:渲染多个用户输入
- python - 意外的 Python 行为 - 函数在 return 语句后无法终止
- javascript - 反应回调函数变量超出范围
- python - 如何根据 DataFrame 中的多个条件计算出现次数
- python - Azure Functions Python Blob 映像
- javascript - python vs javascript中的插入排序
- node.js - NodeJS 中的 AWS RDS SSL 连接错误