Upgrade Glide in xxx Video SDK 4.11.0 Precautions

I need to upgrade xxx sdk today, but encountered many problems during the upgrade process, so make a record:

Problems caused by dependencies not being imported:

The xxx sdk has two packages, the androidx package and the support package. During the process of upgrading the androidx package, when all the aar packages are imported, the gradle configuration is modified, and the configuration items are modified, the synchronization project reports the following error:

The lack of style and attribute configuration was reported, and it was suspected that the corresponding resources were missing in the arr package. I asked the person in charge of the sdk of xxx, and the answer was answered: the reason is that it has not been introduced:

api 'com.github.ybq:Android-SpinKit:1.4.0'

I am ashamed because I was careless in reading the document. I must read the document carefully in the future, and I should pay more attention to the problem of lack of resources in the aar package. I should check whether some libraries in the document are not introduced.

The introduction of the androidx package needs to upgrade the glide problem

In the process of upgrading the androidx package, after compiling and running the program, an xml parsing exception is reported:

At first, I thought it was a problem with a certain control, so I put all my thoughts on checking the properties of the control: in the middle, Baidu found various xml parsing exceptions. Possible reasons: There were references to wrong image resources, style resources, and image resources were not subcontracted. If the real machine cannot get the picture with the actual resolution, this exception will be thrown, and there is also the creation of custom controls

It should contain three construction methods, etc. After checking the code, I found that only two custom controls were written in the code. I was curious why there was no problem before, and then the third construction method with three parameters was also abnormal, and I gradually thought about it. It doesn't work, I feel that I can think of all possible reasons that may cause xml parsing exceptions, but I still can't solve it.

Continue to think: Is it because some initialized attributes in the custom control conflict with the newly introduced package? Try to comment and run the initialization part of the custom control. If it does not report an xml parsing exception, it will throw a null pointer exception This is as expected, so the problem is located in the initialization part of the custom control: after the method of dichotomously annotating half of the code and leaving half of the code to run, locate the location where the exception is thrown as follows:

Glide uses a 4.8.0 package that does not support androidx. After 4.9.0, glide starts to support androidx. Ask the person in charge of xxx sdk to suggest upgrading the dependency of the sdk main project to 4.10.0. The version that supports androidx has been modified after some troubles. After the main project glide version and dependent glide version, run again to solve the problem.

The problem that needs to be noted here is that the added aar package may be related to the dependencies under the main project and other projects. At the same time, it should be noted that glide supports androidx after 4.8.0.

Give up using the androidx package and use the support package

Later, I decided to give up using the sdk of the androidx package and use the support package. The reason is that glide needs to be upgraded, which will cause the Hecai SDK in the original project to crash. It is speculated that Hecai SDK relies on the glide in the main project, and uses glide4.8.0 alone. some way

Problems encountered in support package integration:

This problem is aar package conflict, the two packages contain common classes of all classes:

Contact the person in charge of the sdk to replace the aar package to solve the problem.

Guess you like

Origin blog.csdn.net/new_acm_/article/details/114275924