Skip to content
WebViewGold Vibe Coding to App Store
English
Get WebViewGold

Claude Code

Fixing Android Gradle build errors in the WebViewGold project with Claude Code

Android builds usually fail for unglamorous reasons: Gradle runs on the wrong JDK, Android Studio is older than the project's Gradle plugin, a package rename missed google-services.json, or the bundle is signed with a key Google Play does not expect. Claude Code can run the Gradle wrapper, read the stack trace and fix most of these quickly. Here are the errors, the commands and the parts that stay with you.

From $109 one-time per platform, or let our team do it all from $698.

  • Approval guarantee – or money back within 14 days
  • No coding needed
  • One-time payment, free updates
  • 24/7 human support
  • Made in Germany since 2014 · ISO 27001

Three versions that have to agree

Every Android build depends on three versions fitting together: the JDK that runs Gradle, the Gradle version pinned in gradle/wrapper/gradle-wrapper.properties, and the Android Gradle plugin (AGP) declared in the build files. On top of that, compileSdk and targetSdk in app/build.gradle need the matching SDK platform installed. AGP 8 and newer need at least JDK 17.

The classic trap: Android Studio builds with its own bundled JDK, while Claude Code in the terminal uses whatever JAVA_HOME points to. That is why a project can build fine in the IDE and fail in the agent's shell, or the other way around. Fix the environment first. Upgrading AGP or Gradle to get around a JDK problem is how a ten-minute issue turns into a weekend.

The WebViewGold Android project is a standard Android Studio project (the download folder is called AndroidStudioSource), configured mainly in Config.java and app/build.gradle, as the Android setup documentation shows.

The diagnostic commands

Paste the output into Claude Code, or let the agent run the commands itself. On Windows, use gradlew.bat instead of ./gradlew.

bash
# Run in the folder that contains gradlew

# Versions: Gradle, and the JVM it runs on
./gradlew --version
grep distributionUrl gradle/wrapper/gradle-wrapper.properties
grep -rnE "com.android.tools.build:gradle|com.android.application" build.gradle settings.gradle app/build.gradle
grep -nE "compileSdk|targetSdk|minSdk|applicationId|namespace|versionCode|versionName" app/build.gradle
java -version
echo "JAVA_HOME=$JAVA_HOME"

# Use the JDK that ships with Android Studio (macOS path; on Windows it is
# C:\Program Files\Android\Android Studio\jbr)
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"

# Debug build with a readable log
./gradlew assembleDebug --stacktrace 2>&1 | tee build-debug.log

# Release App Bundle for Google Play (uses your signing config)
./gradlew bundleRelease 2>&1 | tee build-release.log

Errors, causes and fixes

Error (excerpt)CauseFixWho
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.The terminal uses an old JDKPoint JAVA_HOME to the JDK bundled with Android Studio or to JDK 17 or 21. In the IDE: Settings, Build, Execution, Deployment, Build Tools, Gradle, Gradle JDKClaude (terminal), you (IDE setting)
Unsupported class file major version 65The Gradle version is too old for the JDK running it (65 is Java 21)Run Gradle with the JDK the project was made for; raise the wrapper version only if the current WebViewGold project doesClaude
Minimum supported Gradle version is …The wrapper is older than the AGP version requires, often after an accidental AGP upgradeUndo the AGP upgrade, or set the wrapper to the version named in the errorClaude
The project is using an incompatible version (AGP …) of the Android Gradle pluginAndroid Studio is older than the projectUpdate Android Studio; do not downgrade the projectYou
SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable…Command-line builds do not know where the SDK isSet sdk.dir in local.properties (never committed) or export ANDROID_HOMEClaude
Failed to find target with hash string 'android-36'The SDK platform for compileSdk is not installedInstall it in the SDK Manager or with sdkmanager "platforms;android-36"Claude or you
Dependency '…' requires libraries and applications that depend on it to compile against version 36 or laterA library was upgraded beyond the project's compileSdkUndo the library upgrade, or raise compileSdk deliberately and testClaude
No matching client found for package name 'com.example.app'google-services.json still belongs to the old package after a renameRegister the new package in Firebase, download a new google-services.json and replace the one in app/You (Firebase), Claude (file)
Keystore was tampered with, or password was incorrectWrong store password or wrong keystore fileCheck keystore.properties yourself; never paste passwords into the chatYou
Play Console: Your Android App Bundle is signed with the wrong keySigned with a different key than the upload key Google Play expectsCompare SHA-1 fingerprints with keytool -list -v -keystore your.jks; find the right keystore or request an upload key reset in the Play ConsoleYou
Play Console: Version code … has already been usedversionCode was not raisedRaise versionCode in app/build.gradleClaude
Play Console: You uploaded a debuggable APK or Android App BundleA debug build was uploadedBuild with bundleRelease and upload the .aab from app/build/outputs/bundle/release/Claude
Play Console: target API level errortargetSdk is below Google's current requirementSee the targetSdk section belowClaude and you

My iOS WebView is finally approved. Thanks!!

Taha Farooqui · CodeCanyon

Renaming the package without breaking the build

WebViewGold for Android ships with the package name com.webviewgold.myappname, and the publishing documentation asks you to back up the project and rename it before your first upload (with one video for the full rename and one for shortening the name). Three identifiers are involved, and agents tend to change only one of them:

  • applicationId in app/build.gradle: the identity in Google Play. It must be unique and can never change after the first upload; see choose it once.
  • namespace: the package of the generated R and BuildConfig classes.
  • The Java package of the source folders and the package line at the top of each file.

Rename with the refactoring the video shows, then let Claude Code look for leftovers with grep -rn "com.webviewgold.myappname" app/. Update everything that should follow the new name, including google-services.json for Firebase and, if you use App Links, the package name in your assetlinks.json. That file also lists a SHA-256 fingerprint: with Play App Signing, use the app signing key fingerprint shown in the Play Console, not the one of your upload key.

Keep signing out of the repository

If you set up release signing from scratch, this is the standard Android pattern: the signing values come from a keystore.properties file that only exists on your machine. Make it a one-time, reviewed change (write it yourself or let Claude add it once), create the keystore and the properties file yourself, and keep both out of Git. If your project already has a working signingConfigs block, leave it alone.

groovy
// app/build.gradle (excerpt, merge into the existing file)
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    signingConfigs {
        release {
            if (keystorePropertiesFile.exists()) {
                storeFile file(keystoreProperties["storeFile"])
                storePassword keystoreProperties["storePassword"]
                keyAlias keystoreProperties["keyAlias"]
                keyPassword keystoreProperties["keyPassword"]
            }
        }
    }
    buildTypes {
        release {
            // keep the template's existing release options, add only this line
            signingConfig signingConfigs.release
        }
    }
}

// keystore.properties lives next to settings.gradle and is NOT committed
// (add keystore.properties, *.jks and *.keystore to .gitignore):
// storeFile=/Users/you/keys/example-upload.jks
// storePassword=...
// keyAlias=upload
// keyPassword=...

The repair loop

Environment first, project second, signing last.

  1. Prepare the machine

    Install Android Studio and open the project once, so it downloads the SDK and creates local.properties. Then start Claude Code in the folder that contains gradlew.

  2. Diagnose

    Paste the prompt below. Claude collects the versions, runs a debug build with --stacktrace and names the first real error.

  3. Fix the environment

    JDK, SDK path and missing SDK platforms come first. These fixes do not change a single project file.

  4. Fix the project, minimally

    If a project change is unavoidable, the agent proposes the smallest compatible version change and waits for your OK. Commit it separately so it is easy to revert.

  5. Build the release bundle

    Run ./gradlew bundleRelease with your keystore in place, or build it in Android Studio via Build, Generate Signed App Bundle.

  6. Upload to internal testing first

    Paste any Play Console error into Claude Code. New personal developer accounts also need a closed test before production; see the 12 testers requirement.

The diagnosis prompt

Point 5 is the important one: the agent never needs your keystore or passwords to fix a build.

Paste into Claude Code in the Android project folder
This folder is a WebViewGold Android project (it contains gradlew). The build fails. Diagnose before changing anything.

1. Run ./gradlew --version and java -version, print JAVA_HOME, and show: distributionUrl from gradle/wrapper/gradle-wrapper.properties, the Android Gradle plugin version, compileSdk, targetSdk, minSdk, applicationId, namespace, versionCode and versionName.
2. Run ./gradlew assembleDebug --stacktrace and save the output to build-debug.log.
3. Quote the first real error and explain the cause. Say whether it is an environment problem (JDK, SDK location, missing SDK platform) or a project problem.
4. Prefer environment fixes. Do not upgrade the Android Gradle plugin, Gradle, Kotlin or any dependency unless the error makes it unavoidable; in that case propose the smallest compatible change and wait for my OK.
5. Never open, print or change keystore files, keystore.properties, passwords or the signingConfigs block.
6. When the debug build passes, give me the command for the release bundle and list the values Google Play will check: targetSdk against the current requirement, and versionCode against my last upload.

Pitfalls

  • Clicking "Upgrade" on every Android Studio prompt. The AGP Upgrade Assistant is useful between releases, not in the middle of one.
  • Committing machine files. local.properties contains your SDK path, keystores contain your publishing identity. Both belong in .gitignore.
  • Losing the upload key. With Play App Signing, Google holds the app signing key and you can request an upload key reset. Without a backup and without Play App Signing, you cannot update the app. Back up the keystore and its passwords in a password manager today.
  • Search and replace for the package rename. Replacing text across the whole project, build folders included, produces errors that look unrelated. Rename with the IDE, then search for leftovers.
  • Changing applicationId after the first upload. Google Play treats it as a different app with no installs, no reviews and no update path.
  • Expecting a cloud session to build Android. Claude Code on the web runs in a Linux VM with OpenJDK 21 and Gradle but without the Android SDK, so it can edit the project but not build it without extra setup. Build locally or with the Cloud Builder.

Checklist before you upload

  • HOST and HOME_URL in Config.java point to the production domain.
  • applicationId is final and matches the app in the Play Console.
  • versionCode raised, versionName set.
  • targetSdk meets the current Google Play requirement.
  • google-services.json matches the package, if you use Firebase.
  • Signed with the upload key whose SHA-1 the Play Console shows.
  • You upload an .aab file, not an APK.
  • assetlinks.json lists the package and the Play app signing SHA-256, if you use App Links.

Frequently asked questions

Which JDK should the WebViewGold Android project use?

The JDK bundled with Android Studio is the safe default, because that is what the IDE uses for Gradle. AGP 8 and newer need at least JDK 17; use the same JDK in the terminal by pointing JAVA_HOME at it.

Why does the build work in Android Studio but not in Claude Code?

Almost always a different JDK or a missing SDK path in the terminal. Compare the output of ./gradlew --version in both places and set JAVA_HOME and sdk.dir accordingly.

I lost my keystore. Can Claude Code recover it?

Nobody can recover a lost key. If your app uses Play App Signing, request an upload key reset in the Play Console and create a new upload key. Without Play App Signing, a lost key means a new app listing.

Do I have to update WebViewGold for a new targetSdk requirement?

Not strictly, but it is usually the lowest-risk path, because the current project already uses compatible Gradle and plugin versions. Updates are free, and Claude Code can carry your settings over.

Can I build the Android app without Android Studio?

Yes. With the Android SDK command-line tools installed, ./gradlew bundleRelease builds from the terminal. Without any local setup, the Cloud Builder compiles and uploads the app from the browser.

Three ways to get your app into the stores

Same result, different amount of work on your side. All three come with the approval guarantee and 24/7 human support.

Do it yourself

$109 per platform, one-time

The WebViewGold license: a finished Xcode or Android Studio project. Paste your URL, set name and icon, switch on features, build and submit. Free updates forever.

See plans on the main page

Cloud Builder

$349 per license, one-time add-on

No Mac, no Xcode, no Android Studio: configure in the browser, we build both apps in the cloud and hand them to App Store Connect and the Play Console.

How the Cloud Builder works Try the free demo

Full Service

$698 per platform $798

Send us your URL and icon. Our team configures, builds and delivers your app within 72 hours, white-label, with source projects. Both platforms for $1,158.

Full Service details Powered by WeSetupYourWebViewApp

Winter Sale prices valid until December 31, 2026.

Ready to ship your app?

App Store & Google Play approval guarantee – or your money back within 14 days

Rather hand it over? Full Service: we configure, build and deliver within 72 hours, from $698 per platform. Questions? Chat with us 24/7.

Refunds are granted under the conditions listed in our FAQ: a non-content rejection by Apple and/or Google, claimed within 14 days after purchase.