When build a legacy android app, you may encounter this problem:
2.1 The problem
2.2 The reason of this problem
Your android SDK build tools is not compatible with your current android app codes.
There are two solutions to solve this problem
2.3.1 Solution 1: Downgrade your android build SDK tools
- Open your android studio
- Click the SDK manager
- Show package details of the SDK build tools
- Uncheck the build tools which version’s greater then 25.0.3
2.3.2 Solution 2: Copy the dex jars to your build tool directory
For example, if you are using build-tools 27.0.1, you can do as follows:
- goto android-sdk/build-tools/25.0.3/lib
- copy the files in the lib to android-sdk/build-tools/27.0.1/lib
This problem only occurs when you are building an old APP, so it’s time to upgrade your app code.