惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security @ Cisco Blogs
H
Hacker News: Front Page
P
Privacy International News Feed
N
News and Events Feed by Topic
T
Threatpost
Simon Willison's Weblog
Simon Willison's Weblog
S
Schneier on Security
K
Kaspersky official blog
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
Security Latest
Security Latest
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
CERT Recently Published Vulnerability Notes
L
Lohrmann on Cybersecurity
Jina AI
Jina AI
P
Proofpoint News Feed
AI
AI
雷峰网
雷峰网
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 叶小钗
Webroot Blog
Webroot Blog
Apple Machine Learning Research
Apple Machine Learning Research
SecWiki News
SecWiki News
罗磊的独立博客
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
S
Security Affairs
Blog — PlanetScale
Blog — PlanetScale
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
月光博客
月光博客
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Securelist
W
WeLiveSecurity
T
Troy Hunt's Blog
A
Arctic Wolf
博客园 - 司徒正美

博客园 - zjhgx

hjdang 从jdk11升级到jdk25遇到的问题 腾讯云服务器遭受大量请求攻击导致网页打不开 class file for org.apache.shiro.lang.util.Nameable not found class file for org.apache.shiro.lang.util.Nameable not found 使用capacitor遇到的问题记录 shiro的cookie去掉domain后导致用户无法登陆 android真机调试遇到的问题 用java爬取京东商品页注意点 SEO 经验记录 使用goaccess统计nginx日志 nginx日志按天分割 记一次流量爆发导致服务器无响应的记录 mac 安装完Navicat Premium 提示已损坏 无法打开的处理方法 腾讯云问题汇总 vue-element-admin npm install 错误 quasar <q-page>下面<div>自动计算height的问题 Adsense遇到的问题 web项目启动时dubbo报错: No provider available for the service com.davidhu.shopguide.api.service.UserEventService from the url zookeeper ://localhost:2181/org.apache.du quasar ssr模式出现了CLS issue vue ssr里面在template不能出现this,create时this还没有
capacitor的android项目接入穿山甲遇到的坑
zjhgx · 2025-09-23 · via 博客园 - zjhgx

1. 根据文档使用自动拉取adapter工具配置build.gradle,点击“Sync Project With Gradle Files”报错:

Caused by: org.gradle.api.GradleException: 未查找到与baidu 版本为:9.3941 匹配的adapter,请更新SDK至合适版本,如有疑问请联系技术支持。

解决方式是放弃自动拉取adapter工具配置,需要在maven中引入adapter包:

    //---------- GDT ----------
    implementation 'com.pangle.cn:mediation-gdt-adapter:4.642.1512.0'
    implementation(name: "GDTSDK.unionNormal.4.642.1512", ext: 'aar')  //GDT 优量汇 sdk ,通过aar方式引入, 需要把相关aar放到libs目录下,需要保证aar名称和版本号的准确

2. 点运行时报错:

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.bytedance.sdk.openadsdk.TTFileProvider" on path: DexPathList[[zip file "/data/app/~~Ol1vZKiGBPJT4eFuTS5Zyw==/org.capacitor.hjdang-LCtWyqH4mRo9kBlC5ZdjAw==/base.apk"],nativeLibraryDirectories=[/data/app/~~Ol1vZKiGBPJT4eFuTS5Zyw==/org.capacitor.hjdang-LCtWyqH4mRo9kBlC5ZdjAw==/lib/x86_64, /system/lib64, /system_ext/lib64]]

根据官方文档,配置中有:

AndroidManifest.xml

        <provider
          android:name="com.bytedance.sdk.openadsdk.TTFileProvider"
          android:authorities="${applicationId}.TTFileProvider"
          android:exported="false"
          android:grantUriPermissions="true">
          <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/pangle_file_paths" />
        </provider>

解压过打的apk包,发现包里没有这个类。后来搜了下,原来是我这个项目是AndroidX项目(android.useAndroidX=true),在而依赖的包却还是老的依赖。由于这个问题还导致了其他的一些问题,如Manifest合并过程中会报重复class的问题。

解决方法:

在project的gradle.properties里加上 android.enableJetifier=true

android.useAndroidX=true
android.enableJetifier=true

会把依赖自动转换成AndroidX的。

# Post author: 文理兼修电脑首席 @若批评不自由,则赞美无意义
# Post link: https://limxtop1989.github.io/limxtop/2023/08/06/AndroidX-migrate/

Migrate an existing project using Android Studio With Android Studio 3.2 and higher, you can migrate an existing project to AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar. The refactor command makes use of two flags. By default, both of them are set to true in your gradle.properties file: android.useAndroidX=true The Android plugin uses the appropriate AndroidX library instead of a Support Library. android.enableJetifier=true The Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries.

3. 和原来配置有冲突。在AndroidManifest <application>加上

tools:replace="android:allowBackup"
Attribute application@allowBackup value=(true) from AndroidManifest.xml:5:9-35
    is also present at [:GDTSDK.unionNormal.4.642.1512:] AndroidManifest.xml:28:9-36 value=(false).
    Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml