Remember that the Android Wisdom Tooth SDK caused a BUG

Could not determine the dependencies of task ':app:preOnlineDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:onlineDebugRuntimeClasspath'.   > Could not find :unspecified:.     
    Searched in the following locations:       
    - file:/D:/xxxxxxx/xxxxxxx/libs/baseRes/libs/unspecified.jar     
    Required by:         
        project :app > project :modules:mainpage > com.sobot.chat:sobotsupport-glidev4:1.0.10 > com.sobot.chat:sobotsdk-imageloader:1.0.4 
Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
复制代码

The compilation error message is as above, which is really confusing.

The problem is reproduced:

Due to the C drive space alarm, I deleted the gradle cache directory, and then compiled the project, and the above error will be reported. I have tried many solutions, but none of them work. I have not found any solutions to similar problems on the Internet, very mysterious brothers~

problem analysis:

It can be seen that the problem finally points to this SDK, and the solution starts here!

com.sobot.chat:sobotsdk-imageloader:1.0.4
复制代码

The internal situation of the SDK is as shown in the figure below. It is very simple. There is only one abstract class. When we introduce the wisdom tooth SDK, we exclude this SDK and replace this class at the same time. Is it OK? NICE~

Solve the problem:

Step 1: Eliminate introductions.

Step 2: Write your own SobotImageLoader.java class. In fact, it is a copy, pay attention to keep the package name and class name consistent.

Step 3: Initialize (load) the class. In fact, this step is not necessary. Loading in advance is only to ensure that the class is loaded into the virtual when it is used, so as to maintain the robustness of the code. Here it is best to operate in Application.

Summarize:

Through the test, the above processing method can solve this wonderful bug. Record it here, I hope you can have a reference when encountering similar problems, and also hope that you can have a better solution, leave a message and we can communicate together~

Guys,Peace & Love

Guess you like

Origin juejin.im/post/6955038931289276429