当前位置:网站首页>About the project error reporting solution of mpaas Pb access mode adapting to 64 bit CPU architecture
About the project error reporting solution of mpaas Pb access mode adapting to 64 bit CPU architecture
2022-07-05 04:04:00 【High calcium Xiaoxin】
background :
2021 At the end of the year , Domestic manufacturers began to vigorously promote the application market app Conduct 64 Adaptation of bit architecture , And issued relevant regulations , The approximate time is 2022 year 2 Not received from the beginning of the month, only 32 Bit application ,9、10 Receiving containing... Is not supported from the beginning of the month 32 Bit application .
The mobile phones we use are now multi-core CPU, In order to be compatible with as many applications as possible , At present, it is compatible with the kernel 32 Bit applied , This leads to a part of non adaptation 64 The application of bit architecture is still used 32 Bit instruction set , No play 64 position CPU The advantages of , In terms of performance , Operational efficiency , In terms of user experience , Did not conform to the development of the times .
last year arm Launched armv9 Of CPU framework , This new architecture eliminates the super core and medium core for 32 Compatibility of bit applications .
New snapdragon 8 Gen 1 The processor uses the latest armv9 framework ,8 In two cores , Yes 3 individual 2.5GHz Of A710 Big nucleus 、1 individual 3.0GHz Of X2 Meganucleus and 4 individual 1.8GHz Of A510 Median nucleus . If an application doesn't do 64 Bit adaptation , Then you can only use 3 Kernel , When we develop, we often open multiple threads to do some time-consuming operations , So for this 8 Nuclear cell phones only use 3 nucleus The situation of , It's really unacceptable .
Preface :
An zhuozuo 64 Bit architecture adaptation is actually very simple , I wrote a summary before , You can turn it forward if you need it . This article is mainly based on the current architecture of the project (mPaaS frame ,Portal-Bundle Access mode ) Some problems and solutions encountered during adaptation .
The project USES mPaaS Framework of the Portal-Bundle Access mode , For some historical reasons , At first, this mode only supports gradle 4.4 edition , Many conflicts have escalated this time gradle To 6.2 after , The inspection rules are stricter , There are many problems caused by the irregular usage of old projects .
Here is a summary , Also give it to the partners who need it .
One 、64 Bit architecture adaptation
(1) One is upgrading gradle To 6.2 edition ( Can be higher , But stricter inspection rules will expose more problems ), For details, you can refer to this document
mPaaS Support more CPU framework - Mobile development platform mPaaS - Alibaba cloud
(2) A new version of gradle plug-in unit , Also need to adapt mPaaS Plug in related content
common problem - Mobile development platform mPaaS - Alibaba cloud
Two 、 Solve the compilation error
1、 Report errors Cannot change dependencies of dependency configuration ':api:provided' after it has been included in dependency resolution, Pictured :
reason : The official documents say that there is no need to introduce it again android gradle plug-in unit , Just introduce mPaaS gradle Just plug in , But in practice , If it is not introduced, the error shown in the figure above will be reported .
solve : introduce android gradle Official plugin
notes : In many old projects , Most of them use provided 、compile And other abandoned dependency methods , Just take this opportunity , Replace all these .( The difference in usage is Baidu by ourselves )
provided ----> compileOnly
compile -----> api / implementation
2、 Report errors android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor'
reason : This mistake should also be caused by a change in usage
solve :
(1) adopt apt Relying on third parties
// apt 'org.androidannotations:androidannotations:4.4.0'
// Change to
annotationProcessor 'org.androidannotations:androidannotations:4.4.0'
(2) root directory build.gradle Under the use of
//classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// This needs to be deleted or commented out
(3)build.gradle Is cited in 'android-apt' The plug-in
//apply plugin: 'android-apt'
// This usage should also be deleted
3、 Report errors Could not find the AndroidManifest.xml file, using generation folder
reason : The project relies on org.androidannotations:androidannotations:4.4.0 This library . I don't know the specific principle
solve :
(1) Reduce gradle Version of ( We upgraded just for adaptation gradle 4.4 To 6.2 , So it's not feasible )
(2) stay build.gradle in defaultConfig Add the following code , Which one? moudle Depend on which moudle Medium plus
android {
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
arguments = [
// 'resourcePackageName': "com.mobile.mbank.search",
"androidManifestFile": "$projectDir/src/main/AndroidManifest.xml".toString()
]
}
}
}
}
I commented out the line of configuring the package name above , It will cause other errors , Configure only androidmanifest.xml It can also solve my current compilation error .
4、 Report errors The SourceSet 'flatDir' is not recognized by the Android Gradle Plugin.
reason : I don't know why other development is in sourceSets The following is used flatDir , I checked and found no such usage , As for why I didn't report errors before , I don't know , Just change to the correct usage .
solve :
sourceSets {
flatDir {
assets.srcDirs = ['../api/src/main/assets']
}
}
// Change to the following
sourceSets {
main {
assets.srcDirs = ['../api/src/main/assets']
}
}
5、 Report errors error: item inner element must either be a resource reference or empty.
reason : gradle The resource format verification is more stringent
solve :
<item type="id" name="about_process_icon">false</item>
// Change to the following
<item type="id" name="about_process_icon"/>
For other resource format issues, please refer to the following article of the boss , I also read his article to change
6、 Report errors Caused by: com.android.tools.r8.utils.AbortException: Error: Program type already present: com.xxxx.xxx.xxx
reason : The third party depends on the repeated reference of packages . Because there are many bundle project , Plus the developers' non-standard operation in the early stage , It will eventually lead to the integration of multiple bundle When packing , There is a conflict of repeated dependencies of the same third-party library , Even the conflict of dependencies under different third-party libraries ( This is more troublesome ).
solve :
(1) If it is only in the current bundle The use of , Use as much as possible compileOnly The way , It can avoid dependency conflicts during packaging to the greatest extent .
(2) Try to unify the third-party dependencies into one bundle Manage , adopt api moudle Use compile Way for others bundle Provides access to .
(3) If there is a dependency conflict between different third-party libraries , Can pass gradle dependencies Command to check which libraries are in conflict , Then remove the dependency . Specific methods can be Baidu .
边栏推荐
- Interview summary: This is a comprehensive & detailed Android interview guide
- CTF stegano practice stegano 9
- Number of possible stack order types of stack order with length n
- 【看完就懂系列】一文6000字教你从0到1实现接口自动化
- provide/inject
- Is "golden nine and silver ten" the best time to find a job? Not necessarily
- error Couldn‘t find a package. JSON file in "your path“
- UE4 DMX和grandMA2 onPC 3.1.2.5的操作流程
- 官宣!第三届云原生编程挑战赛正式启动!
- MindFusion.Virtual Keyboard for WPF
猜你喜欢
laravel8 导出Excle文件
Use threejs to create geometry, dynamically add geometry, delete geometry, and add coordinate axes
基于TCP的移动端IM即时通讯开发仍然需要心跳保活
面试汇总:这是一份全面&详细的Android面试指南
How to realize real-time audio and video chat function
Differences among 10 addressing modes
PlasticSCM 企业版Crack
[brush questions] BFS topic selection
输入的查询SQL语句,是如何执行的?
Rust区块琏开发——签名加密与私钥公钥
随机推荐
How to use jedis of redis
技术教程:如何利用EasyDSS将直播流推到七牛云?
How to solve the problem that easycvr changes the recording storage path and does not generate recording files?
Clickpaas low code platform
Analysis of glibc strlen implementation mode
[数组]566. 重塑矩阵-简单
基于TCP的移动端IM即时通讯开发仍然需要心跳保活
The development of mobile IM based on TCP still needs to keep the heartbeat alive
Use threejs to create geometry and add materials, lights, shadows, animations, and axes
面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
在线SQL转Excel(xls/xlsx)工具
在线文本行固定长度填充工具
Why can't all browsers on my computer open web pages
阿里云ECS使用cloudfs4oss挂载OSS
长度为n的入栈顺序的可能出栈顺序
线上故障突突突?如何紧急诊断、排查与恢复
[punch in questions] integrated daily 5-question sharing (phase III)
Use threejs to create geometry, dynamically add geometry, delete geometry, and add coordinate axes
Threejs rendering obj+mtl model source code, 3D factory model
MindFusion. Virtual Keyboard for WPF