当前位置:网站首页>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 .
边栏推荐
- 长度为n的入栈顺序的可能出栈顺序
- @The problem of cross database query invalidation caused by transactional annotation
- Containerd series - detailed explanation of plugins
- Installation of postman and postman interceptor
- Timing manager based on C #
- Rust blockchain development - signature encryption and private key public key
- A应用唤醒B应该快速方法
- JVM garbage collection
- Test d'automatisation de l'interface utilisateur télécharger manuellement le pilote du navigateur à partir de maintenant
- Threejs Internet of things, 3D visualization of factory
猜你喜欢

EasyCVR更改录像存储路径,不生成录像文件如何解决?

Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery

laravel8 导出Excle文件

NEW:Devart dotConnect ADO.NET

输入的查询SQL语句,是如何执行的?

kubernetes集群之调度系统

IronXL for . NET 2022.6

Technical tutorial: how to use easydss to push live streaming to qiniu cloud?

JWT vulnerability recurrence

测试开发是什么?为什么现在那么多公司都要招聘测试开发?
随机推荐
官宣!第三届云原生编程挑战赛正式启动!
[wp][introduction] brush weak type questions
Clickhouse synchronization MySQL (based on materialization engine)
provide/inject
Threejs Internet of things, 3D visualization of factory
Rust blockchain development - signature encryption and private key public key
Deep learning - LSTM Foundation
DMX parameter exploration of grandma2 onpc 3.1.2.5
Why do big companies such as Baidu and Alibaba prefer to spend 25K to recruit fresh students rather than raise wages by 5K to retain old employees?
[an Xun cup 2019] not file upload
Containerd series - what is containerd?
[wp]bmzclub writeup of several questions
花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
根据入栈顺序判断出栈顺序是否合理
JVM garbage collection
ClickPaaS低代码平台
How does the applet solve the rendering layer network layer error?
快手、抖音、视频号交战内容付费
行为感知系统
WGS84 coordinate system, web Mercator, gcj02 coordinate system, bd09 coordinate system - brief introduction to common coordinate systems