当前位置:网站首页>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 .
边栏推荐
- How to use jedis of redis
- Analysis of dagger2 principle
- [understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
- 阿里云ECS使用cloudfs4oss挂载OSS
- Interview summary: This is a comprehensive & detailed Android interview guide
- Installation of postman and postman interceptor
- Pyqt5 displays file names and pictures
- 花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
- 【无标题】
- Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
猜你喜欢

面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?

【刷题】BFS题目精选
![[数组]566. 重塑矩阵-简单](/img/3c/593156f5bde67bd56828106d7bed3c.png)
[数组]566. 重塑矩阵-简单

Use Firefox browser to quickly pick up Web image materials

Use threejs to create geometry and add materials, lights, shadows, animations, and axes

Threejs realizes the drawing of the earth, geographical location annotation, longitude and latitude conversion of world coordinates threejs coordinates

Timing manager based on C #

官宣!第三届云原生编程挑战赛正式启动!

Alibaba cloud ECS uses cloudfs4oss to mount OSS

How to solve the problem that easycvr changes the recording storage path and does not generate recording files?
随机推荐
Why can't all browsers on my computer open web pages
[understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
Thread Basics
JWT vulnerability recurrence
[punch in questions] integrated daily 5-question sharing (phase III)
Analysis of glibc strlen implementation mode
面试汇总:这是一份全面&详细的Android面试指南
【刷题】BFS题目精选
Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
Phpmailer reported an error: SMTP error: failed to connect to server: (0)
特殊版:SpreadJS v15.1 VS SpreadJS v15.0
Use Firefox browser to quickly pick up Web image materials
provide/inject
Special Edition: spreadjs v15.1 vs spreadjs v15.0
MindFusion. Virtual Keyboard for WPF
EasyCVR平台出现WebRTC协议视频播放不了是什么原因?
English essential vocabulary 3400
WGS84 coordinate system, web Mercator, gcj02 coordinate system, bd09 coordinate system - brief introduction to common coordinate systems
This article takes you to understand the relationship between the past and present of Bi and the digital transformation of enterprises
Plasticscm enterprise crack