Home › Build error fixes › Android / Gradle
A permission is declared twice with different maxSdkVersion
Android / Gradle · last reviewed 2026-11-10
The error looks like this
Duplicate declarations of permission android.permission.WRITE_EXTERNAL_STORAGE with different maxSdkVersions.
Why it happens
Your manifest and a library (or two libraries) both declare the same permission with different limits.
How to fix it
- See who adds it: releasemedic aab app.aab lists the merged permissions.
- In android/app/src/main/AndroidManifest.xml declare it once and override the others: <uses-permission android:name="…" android:maxSdkVersion="…" tools:replace="android:maxSdkVersion" /> (add xmlns:tools to the manifest tag).
Not sure this is your error? Let ReleaseMedic read the whole log
Build logs are long and the last line is rarely the real cause. ReleaseMedic finds the first real error, explains it and gives the steps — free, and the log never leaves your computer.
$ npx releasemedic log build.logOr pipe a build straight in: cd android && ./gradlew bundleRelease 2>&1 | npx releasemedic log -
Catch it before you build
Most release errors come from project settings you can check in seconds — signing, SDK levels, privacy manifests, permissions, push and login setup.
$ npx releasemedic