Can you build a decompiled apk in Android Studio?

Viewed 669

There's an old app from 2012 that I want to use but it keeps crashing and it's no longer on the Play Store. After not being able to find any similar app I decided to find what exactly the problem was with this one by decompiling it using jadx-gui. I then opened the decompiled code in Android Studio but when trying to build the project it gives this error:

Gradle sync failed: Gradle version 2.2 is required. Current version is 6.1.1. If using the gradle wrapper, try editing the distributionUrl in C:\Program Files\Android\Android Studio\jre\jre\bin\gradle\wrapper\gradle-wrapper.properties to gradle-2.2-all.zip

3 Answers

Go to you project level than look for gradle folder inside this you will find wrapper, open gradle-wrapper.properties and update it with below code and rebuild your project.

 distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

and update your project level build.gradle

 dependencies {
        classpath 'com.android.tools.build:gradle:4.1.1'
}

This appears to be a Gradle problem. Go to the gradle/wrapper folder under the project folder, there should be a gradle-wrapper.properties file, which contains:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

Change the 6.1.1 to 2.2, then re-build the project.

You can try using the latest jadx nightly build

Related