Google Play: Bundle was not signed - android

I'm creating app in Kotlin and I paid Google developer account. But there is some problem with upload .aab file: The Android App Bundle was not signed. I readed all topics at Stackoverflow about it and tried all solutions. Not works for me.
signingConfig signingConfigs.release in build.gradle ends with this error: Could not get unknown property 'release' for SigningConfig. It works only when I set signingConfig. I'm using also this: minifyEnabled false and debuggable = false. So what another I must to try? There exists some new solution for year 2021?!
My build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId '...'
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.00"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders["hostName"] = "..."
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig
debuggable = false
}
applicationVariants.all{
variant ->
variant.outputs.each{
output->
def name = "...apk"
output.outputFileName = name
}
}
}
buildFeatures{
dataBinding = true
viewBinding = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'com.github.amitshekhariitbhu.Fast-Android-Networking:android-networking:v1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}

I had the same issue when I set "debuggable true" for release build type variant,
pls ensure "debuggable false" is set for release type.
buildTypes {
release {
minifyEnabled true
debuggable false
}

Step by step how to create signed aab file:
In the next window select Android App Bundle (aab)
Now you have to create your own signing key. If you want upload any update in the future, you must sign it with this signing key you created here.
Also every update you need to increment version in build.gradle(app).
Edit 1:
Change: signingConfig to: signingConfig signingConfigs.release and add this:
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
The full code:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId '...'
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.00"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders["hostName"] = "..."
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
debuggable = false
}
applicationVariants.all{
variant ->
variant.outputs.each{
output->
def name = "...apk"
output.outputFileName = name
}
}
}
buildFeatures{
dataBinding = true
viewBinding = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'com.github.amitshekhariitbhu.Fast-Android-Networking:android-networking:v1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
Edit 2:
I just uploaded the project aab to Google Play with this build.gradle(app):
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 31
defaultConfig {
applicationId "pfhb.damian.uploadtest"
minSdk 28
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

You have to create signing config release, Hope this will work. Let me know if you want to know how to create this block will be more happy to help you.
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'com.google.gms.google-services'
}
//repositories { maven { url 'https://maven.cashfree.com/release' } }
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.xyz.medicine"
minSdkVersion 27
targetSdkVersion 30
versionCode 4
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
// Please check if you have this block or not
signingConfigs {
release {
storeFile file('../secrets/keystore.jks')
storePassword 'DUMMYPASSWORD'
keyAlias 'DUMMYALIAS'
keyPassword 'DUMMYPASSWORD'
}
}
buildTypes {
release {
resValue "string", "BASE_URL", "https://obhaiyya.com/proMaid/"
shrinkResources true
minifyEnabled true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
shrinkResources false
minifyEnabled false
debuggable true
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
buildFeatures {
dataBinding true
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-messaging-ktx:22.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation "com.airbnb.android:lottie:3.7.1"
}

Related

Plugin with id 'com.onesignal.androidsdk.GradleProjectPlugin' not found

I'm trying to run my code in android studio
this is my error
Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with
id 'com.onesignal.androidsdk.GradleProjectPlugin' not found.
This is my module code :
apply plugin: "com.android.application" apply from: "../utils.gradle"
apply plugin: "com.onesignal.androidsdk.GradleProjectPlugin"
android { compileSdkVersion 32 buildToolsVersion "30.0.3"
defaultConfig { applicationId "com.zakat" minSdkVersion 19
targetSdkVersion 32 versionCode getVersionCode(VERSION_MAJOR,
VERSION_MINOR, VERSION_PATCH, VERSION_BUILD) versionName
getVersionName(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
multiDexEnabled true vectorDrawables.useSupportLibrary = true }
signingConfigs { release { def keystoreProperties =
getKeystoreProperties
file("../${project.property('keystore.properties')}") storeFile
file("../${project.property('keystore.file')}") storePassword
keystoreProperties["keystore.store.password"] keyAlias
keystoreProperties["keystore.key.alias"] keyPassword
keystoreProperties["keystore.key.password"] } }
buildTypes { debug { buildConfigField "boolean", "LOGS", "true"
buildConfigField "boolean", "DEV_ENVIRONMENT", "true"
buildConfigField "boolean", "TEST_ADS", "false"
versionNameSuffix "-debug" }
release { buildConfigField "boolean", "LOGS", "false"
buildConfigField "boolean", "DEV_ENVIRONMENT", "false"
buildConfigField "boolean", "TEST_ADS", "false"
signingConfig signingConfigs.release zipAlignEnabled true
minifyEnabled false shrinkResources false proguardFiles
getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
} }
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 }
setProperty("archivesBaseName", getArtifactName(defaultConfig))
// workaround for https://issuetracker.google.com/issues/141132133
configurations.all { resolutionStrategy { force
"androidx.appcompat:appcompat:1.2.0-rc02" } } }
dependencies { implementation fileTree(dir: "libs", include:
["*.jar"]) implementation(name: "config", ext: "aar") implementation
"androidx.appcompat:appcompat:1.2.0-rc02" // workaround for
https://issuetracker.google.com/issues/141132133 implementation
"androidx.fragment:fragment:1.2.5" implementation
"androidx.multidex:multidex:2.0.1" implementation
"com.google.android.ads.consent:consent-library:1.0.8" implementation
"com.google.android.material:material:1.1.0" implementation
"com.google.firebase:firebase-ads:19.3.0" implementation
"com.google.firebase:firebase-analytics:17.4.4" implementation
"com.google.firebase:firebase-messaging:20.2.4" implementation
"com.onesignal:OneSignal:3.15.1" implementation
"org.alfonz:alfonz-utility:0.9.2" implementation
"org.alfonz:alfonz-view:0.9.2" classpath
"gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.11.0"
//classpath
"gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1,
0.99.99]" classpath "com.google.gms:google-services:4.2.0" }
apply plugin: "com.google.gms.google-services"
Can anyone help me? Thank you

Getting error in build.gradle : No signature of method: build_2gzryvmsr2xvhzda2muxrnzeq.android() is applicable for argument types

I'm trying to define product flavors like this but getting error in the same:
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.test.test"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
dataBinding {
enabled = true
}
buildTypes {
release {
debuggable false
useProguard true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions 'default'
productFlavors {
uat {
applicationId "com.test.test"
versionCode 1
versionName "1.0.0"
buildConfigField "String", 'HOST', '""'
resValue 'string', 'app_name', "Test"
isDefault.set(true)
}
prod {
applicationId "com.test.test"
versionCode 1
versionName "1.0.0"
buildConfigField "String", 'HOST', '""'
resValue 'string', 'app_name', "Test"
}
}
aaptOptions {
cruncherEnabled = false
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//Resize library
implementation 'com.intuit.sdp:sdp-android:1.0.6'
//Spinkit
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
//Kotlin Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0"
//Retrofit & GSON Parsing
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.7.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okio:okio:2.8.0'
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.4.1"))
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:okhttp-urlconnection")
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
implementation "com.squareup.moshi:moshi-adapters:1.5.0"
}
Here's the error
org.gradle.api.GradleScriptException: A problem occurred evaluating project ':app'.
Caused by: groovy.lang.MissingMethodException: No signature of method: build_2gzryvmsr2xvhzda2muxrnzeq.android() is applicable for argument types: (build_2gzryvmsr2xvhzda2muxrnzeq$_run_closure1) values: [build_2gzryvmsr2xvhzda2muxrnzeq$_run_closure1#64cb0e38]
at build_2gzryvmsr2xvhzda2muxrnzeq.run
Can anyone help me with this?
Thanks in advance.
The problem is here:
buildTypes {
release {
debuggable false
useProguard true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
delete useProguard true the problem will be resolved

Very few supported devices of my Flutter app on PlayConsole

Its been a very fun adventure with Flutter so far and my app just got published in PlayStore but I have 2 problems
Its not visible on most devices
The supported devices is VERY FEW (25 only)
How do I increase the supported versions of Androids? Like from Jellybean to latest?
Its an ALPHA RELEASE
below is the image for reference
my APP-LEVEL build.gradle
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.hivemanila.syncshop_webview"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

Why does adding product flavors to my libraries build.gradle file cause my local app to be unable to resolve imported dependencies from said library?

I'm developing an android application for my company. The project holds directories: our sdk (library in this case) and a sample app that imports the sdk. When I add product flavors to the sdk (library) the app breaks due to being unable to resolve the dependencies imported from the sdk.
The errors are:
error cannot find symbol class S
error cannot find symbol class SO
error package S does not exist
error method does not override or
implement a method from a supertype
Here is the top-level/project level build.gradle file
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.novoda:bintray-release:0.9'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is the SDK/Library build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.novoda.bintray-release'
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName version
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultPublishConfig "nonlocationVersionRelease"
publishNonDefault true
flavorDimensions "version"
productFlavors {
nonlocation {
dimension "version"
}
location {
dimension "version"
}
}
buildTypes {
release {
minifyEnabled false
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
lintOptions {
abortOnError false
}
}
configurations {
javadocDeps
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
}
publish {
userOrg = '*******'
groupId = 'com.*******.android'
artifactId = '*******'
publishVersion = '2.0.0'
desc = '******* sdk'
website = 'https://github.com/*******/*******-android-public-sdk'
}
and here is the app's build.gradle file:
apply plugin: 'com.android.application'
def computeVersionCode = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', 'HEAD', '--count'
standardOutput = stdout
}
return stdout.toString().trim().toInteger();
}
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.*******.demo"
minSdkVersion 15
targetSdkVersion 27
versionCode computeVersionCode()
versionName "1.0"
renderscriptTargetApi 20
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
signingConfigs {
debugConfig {
storeFile file("debug.jks")
storePassword "*******"
keyAlias "com.*******.android"
keyPassword "*******"
}
releaseConfig {
storeFile file("release.jks")
storePassword "*******"
keyAlias "com.*******.android"
keyPassword "*******"
}
}
buildTypes {
debug {
signingConfig signingConfigs.debugConfig
}
release {
signingConfig signingConfigs.releaseConfig
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:preference-v7:27.1.1'
implementation 'com.google.guava:guava:23.0'
implementation 'com.squareup:seismic:1.0.2'
implementation 'net.hockeyapp.android:HockeySDK:3.7.0'
implementation 'jp.wasabeef:blurry:1.0.5'
implementation project(path: ':*******-sdk', configuration:'default')
}
I have been trying to fix this for 4 days and am still stuck. I've tried all of the typical solutions found on stackoverflow. This has been a cascade of problem after problem and this specific one came directly after updating how the sdk is loaded in the app's build.gradle file. I suspect something is wrong with this line where I import the sdk as a dependency (end of app's build.gradle):
implementation project(path: ':*******-sdk', configuration:'default')
but not including 'configuration: 'default'' causes another bug where the app cannot discern which buildVariant of the SDK to use.
How can I get my app up and running while also maintaining the product flavors found in the SDK?

gradle signingconfigs not found

In my application I want create debug and release build types
Here is my gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.pmbo.android.pmb"
minSdkVersion 15
targetSdkVersion 21
versionCode 10001
versionName "1.0"
}
signingConfigs {
myConfigs{
storeFile file("ncv.jks");
storePassword("qwerty");
keyAlias("MyNewApp");
keyPassword("qwerty");
}
}
buildTypes {
release {
minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig singningConfigs.myConfigs
}
debug {
debuggable true
applicationIdSuffix ".debug"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.google.code.gson:gson:2.3.1'
}
Everytime I try to build gradle I have this error
Error:(30, 0) Could not find property 'singningConfigs' on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, applicationIdSuffix=null, versionNameSuffix=null, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[/Users/pmb/opt/sdk/tools/proguard/proguard-android.txt, /Users/pmb/Documents/MyProjects/PMBO/app/proguard-rules.pro], mConsumerProguardFiles=[], mManifestPlaceholders={}}.
I don't what I did wrong but looked everywhere and couldn't figure out what's the problem here.
My .jks file in my app module as shown in that picture.
Could anyone just tell me what I did wrong?
Error:(30, 0) Could not find property 'singningConfigs' on
Note that the property in the error message is singningConfigs. The real property is signingConfigs. Change:
signingConfig singningConfigs.myConfigs
to:
signingConfig signingConfigs.myConfigs
If you are using gradle experimental 0.7, you can use the following way to create signature:
apply plugin: "com.android.model.application"
model {
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
buildTypes {
release {
signingConfig = $("android.signingConfigs.myConfig")
}
}
}
android.signingConfigs {
create("myConfig") {
storeFile "/path/to/debug.keystore"
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
storeType "jks"
}
}
}
Hope this help those who uses gradle experimental versions.
try to change
signingConfig singningConfigs.myConfigs
to
signingConfig signingConfigs.release

Categories

Resources