I want to create a signed bundle to release to google play but I can not create it, I can create the debug bundle or debug Apk but i can not create or even build my project in release. when I try it gives me the following error error that is it's giving me and here is a screenshort of my gradle file enter image description here`. so far i have tried searching for the reason why but I can't find why I can even checked for any error within the project, I even update my android studio, and gradle plugin but i still can't find the solution. so i create another project of which i was able to create the signed bundle without any error. the difference i found was that, for the project I can build a signed bundle it has no error but for the one i can not I have this error "Error: The apk for your currently selected variant cannot be signed.picture of error . Please specify a signing configuration for this variant (release)." I have search online but anything seems to work for me.i have tried signing in with both the keystoke that i used for the other project and a new one but I still cannot get rid of the error. Note the error goes away when i change the build variant from release to debug, but comes when i bring it back to release. please help . your help will be very much appreciated
CodePudding user response:
It says you are using lower version of gradle plugin(7.0.4). Upgrade gradle plugin version in your project's build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
...
...
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
CodePudding user response:
Alright so I found the problem, the problem was the I had some errors in the res folder. and the thing with these errors was that we could not be detected by android studio until I opened the files. so if anyone ever runs through this problem, my suggestion would be that you check through all the files in your res directory and maybe you will find your bugs. other thanks for @kamal for giving it a short, I updated gradle there I believe my project got better.