This is the ninth day of my participation in the August More text Challenge. For details, see: August More Text Challenge.

In The Android development process, there are times when you get caught importing duplicate packages into a project, especially when you’re working on someone else’s project, or collaborating on a project, Repeat import package problems usually quote Error: Execution failed for task ‘: app: transformDexArchiveWithExternalLibsDexMergerForDebug’. Error message.

The following error message is displayed:

Method 1: In this case, the developer usually introduces a new toolkit into the project without knowing it, and then immediately reports the error. The solution to this problem is as simple as looking at the toolkits introduced in build.gradle, comparing and looking for duplicate toolkits, deleting one of the same toolkits, and recompiling the project. This is the most basic method.

Method 2: However, if there are too many toolkits referenced in the project, it is not easy to check and find duplicate toolkits, you need to use the killer tool, this method can be set up for life, the specific steps are as follows.

1. Go to the top menu bar of Android Studio and go to File — >Other Settings — >Default Settings.

2. Then go to the Default Preferences interface and select the “Compiler” option in the “Build, Execution, Deployment” directory on the left menu.

3. In the Compiler module selection, look for the “command-line Options:” option, and enter the “– StackTrace Command line” in the input box for this option, then click the “Apply” button at the bottom;

4. Click the “Apply” button and then click the “OK” button.

5, then click on the project to compile the project, and then you will see the prompt to reuse the package name of the toolkit, and then delete the duplicate reference package.

 

Pay attention toIf the project continues to report errors after the duplicate package is removed, then compile and clean the project cache a few more times to resolve the error.

If, as shown in Method 2, all toolkits with error messages are deleted, but the method in the project that depends on the package is “undefined”, it is likely that the tool package itself has a problem. To solve this problem, try lowering the version or raising the version. The compile ‘com. Making. Bumptech. Glide: glide: replace 3.7.1 “into the compile’ com. Making. Bumptech. Glide: glide: 3.7 ‘

Or is the compile ‘com. Making. Bumptech. Glide: glide: replace 3.7.1 “into the compile’ com. Making. Bumptech. Glide: glide: 3.7.2 ‘problems should be solved.

The last

The above is all of this chapter, welcome to pay attention to three shopkeeper’s wechat public number “program ape by three shopkeeper”, three shopkeeper’s Sina Weibo “three shopkeeper 666”, welcome to pay attention!