This question is fairly old on Stackoverflow but none of the provided solutions worked for me.
So I try to generate an Android App Bundle with Android Studio and first receive the message
Generate Signed Bundle: Errors while building Bundle file. You can find the errors in the 'Messages' view.
which results in
Cause: argument type mismatch
Then in the terminal I run
./gradlew build --warning-mode all
which gives me:
So I tried various things:
- Android Studio (Arctic Fox) => Preferences => Build/Execution/Deployment => Buidl Tools => Gradle => set Version to 11.0.10
I also tried Version 17. No success. Still the same error on building
-
I reset Android Studio to default settings. After restart there was a popup asking me to change SDK from 1.8 – I clicked there and did the change. No success. Still the same error.
-
I run ./gradlew –version in Terminal and receive this
So basically everything I do regarding changing the SDK has no effect. Honestly I am out of options now and don’t know what to do next.
2
Answers
As I can see, your gradle project still uses JDK 1.8. There can be two solutions:-
Add this to your
gradle.properties
file:org.gradle.java.home=path/to/jdk/11+
Ensure that your
gradle.properties
file doesn’t have a java home declaration and then, append the path of JDK 11bin
folder to yourPATH
environment variable.On MAC, this worked for me