当前位置:网站首页>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 .
边栏推荐
- 10种寻址方式之间的区别
- Use threejs to create geometry, dynamically add geometry, delete geometry, and add coordinate axes
- 根据入栈顺序判断出栈顺序是否合理
- [charging station]_ Secular wisdom_ Philosophical wisdom _
- 基于TCP的移动端IM即时通讯开发仍然需要心跳保活
- [wp][introduction] brush weak type questions
- 长度为n的入栈顺序的可能出栈顺序种数
- UE4 DMX和grandMA2 onPC 3.1.2.5的操作流程
- Excuse me, my request is a condition update, but it is blocked in the buffer. In this case, can I only flush the cache every time?
- Use object composition in preference to class inheritance
猜你喜欢
How to use jedis of redis
[untitled]
【刷题】BFS题目精选
The new project Galaxy token just announced by coinlist is gal
Containerd series - detailed explanation of plugins
NEW:Devart dotConnect ADO. NET
我国算力规模排名全球第二:计算正向智算跨越
Use Firefox browser to quickly pick up Web image materials
Is "golden nine and silver ten" the best time to find a job? Not necessarily
【无标题】
随机推荐
Analysis of glibc strlen implementation mode
Test d'automatisation de l'interface utilisateur télécharger manuellement le pilote du navigateur à partir de maintenant
[数组]566. 重塑矩阵-简单
lds链接的 顺序问题
Operation flow of UE4 DMX and grandma2 onpc 3.1.2.5
Differences among 10 addressing modes
Use threejs to create geometry, dynamically add geometry, delete geometry, and add coordinate axes
MindFusion.Virtual Keyboard for WPF
[punch in questions] integrated daily 5-question sharing (phase III)
【看完就懂系列】一文6000字教你从0到1实现接口自动化
[software reverse analysis tool] disassembly and decompilation tool
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
JWT漏洞复现
Threejs loads the city obj model, loads the character gltf model, and tweetjs realizes the movement of characters according to the planned route
The order of LDS links
Analysis of dagger2 principle
Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery
行为感知系统
@The problem of cross database query invalidation caused by transactional annotation
Assembly - getting started