You cannot remove all production APKs and Android App Bundles - android-studio

When I have used new version of google play console there is error showing, When I uploaded the appbundle or apk there are error message shows
I have tried looking for the solution on google but I don't find any solution relative to my problem.
When I clicked on Review release there are message showing (You cannot remove all production APKs and Android App Bundles)

I found that solution.
When I uploaded the .aab, I found that error too.
So I built the .apk and then I released it again. It was not showing an error and completed the release.
I think before your previous version is an .apk and now the uploaded file type is an .aab.
Is that right?

Increase the version name & code then upload it. I have already uploaded apk with same version name & code but with stagged rollout of 35 percent. When I was uploading aab file was getting the error. Resolved after increasing the increasing the version name & code value.

Kindly update compileSdkVersion and TargetSdkVersion to
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
}

Related

Unknown attribute warning in XML

AndroidManifest and XML layouts are showing me the Unknown attribute android: warning even though the attributes exist and the app works on the device.
Example: Unknown attribute android:maxSdkVersion, android:clickable="true" etc.
I am aware of the other questions regarding this issue and tried everything I could find about this topic but nothing works for me.
I tried to:
Sync Project with Gradle Files
Delete the .idea and .gradle folders from the project location
Delete caches from c:\Users\<user>\.gradle\caches\
Invalidate caches and restart ...and many other things I couldn't remember right now.
The problem still persists on a newly installed OS (Windows 11) and obviously, newly installed Android Studio, and also the issue affects only old projects...
Also, my project is up to date with everything the Android Studio doesn't show me any warning to update a version of a dependency or so.
Gradle version 7.3.3
Android Gradle Plugin Version 7.2.1
Update:
The warning appears only with the SDK version 33 (compileSdkVersion 33), if I build with version 32, the warning disappears...
Update2:
New projects which use API level 33 still show the warning...
Maybe it's a bug in the SDK?
UPD 20.01.2023: You can update Android Studio to the latest version now (Android Studio Electric Eel | 2022.1.1) and this bug is fixed there. Worked for me.
OLD: Got same crap and a lot of other.
And yes, just downgraded buildToolsVersion to "32.1.0 rc1" and targetSdkVersion, compileSdkVersion to API 32 for as long as bug exists in API 33.
Same here, I use this temporary workaround until Android team fix this issue or better solution.
Move all require code for Android 13 into library module (in my case, all of them are moved into utility module) and keep it use compile SDK 33
Temporary changes compile SDK in other module to 32 for local development
It's not ideal, but switching to Dolphin RC1 resolves this. Given that it will (presumably) hit stable pretty soon, it may not get fixed in Chipmunk. You can download Dolphin from the Android Studio Preview page, just be aware that it is not available as an installer so you will need to manually update your installed version or use it alongside until it hits stable.
Perfect!!
set compileSdkVersion to 32
compileSdkVersion 32
set targetSdkVersion to 32
targetSdkVersion 32
downgrade androidx.core:core-ktx
implementation 'androidx.core:core-ktx:1.8.0'
This config works for me:
Android Studio Dolphin | 2021.3.1
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
compileSdk 33 (SDK 33 Rev. 2, Sources 33 Rev. 1)
buildToolsVersion "33.0.0"
targetSdkVersion 33
Gradle Plugin version 7.3.0.

uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Earlier we were using Android API level 28 with minSdkVersion as 19 in config.xml and the app was available in the play store. Recently we updated the android version ( By removing and adding latest android as google play console mandated to have android above API level 29 ). Bu doing this ionic build gave below error :
Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library [:CordovaLib] D:\MobileApp\MyApp\platforms\android\CordovaLib\build\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 22,
or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)
Due to this app could be updated in could of mobile phones. Please suggest if there is any way to have 19 as minSdkVersion.
Thanks !
Try to change the minSDKVersion to 22 in your config.xml file. I think the problem will be resolved. I had the same problem.
Example: <preference name="android-minSdkVersion" value="22" />
I have solution, it's not very complicated :
Enter on "player settings" (file --> build settings --> player settings) and scroll.
When you see "Minimum API Level", chante that (i choice Android 8.0 "Oreo" (API Level 26)).
Try adding this 1 line code below, under Gradle Scripts > gradle.properties (Project Properties) > Syn now > Build (Clean project > Rebuild project)
android.suppressUnsupportedCompileSdk=32

Playstore error: App Bundle contains native code, and you've not uploaded debug symbols

When I want to release a new flutter app bundle to the Playstore. I get this error:
"This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug."
I can't find any way to fix this. I'm new with flutter and releasing app's and getting a bit desperate...
Any help would be fantastic.
When I add "android.defaultConfig.ndk.debugSymbolLevel = 'FULL'" (on line 1) to the app/build.gradle as suggested in https://developer.android.com/studio/preview/features#native-crash-symbolization. I get This error in the Android studio terminal. I use this command "flutter build appbundle".
Error in Terminal:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\filip\AndroidStudioProjects\ehbo\android\app\build.gradle' line: 1
What went wrong:
A problem occurred evaluating project ':app'.
Could not get unknown property 'android' for project ':app' of type org.gradle.api.Project.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
Running Gradle task 'bundleRelease'...
Running Gradle task 'bundleRelease'... Done 4,3s
Gradle task bundleRelease failed with exit code 1
Reproduce next steps and this warning will disapear
Go to
[YOUR_PROJECT]\build\app\intermediates\merged_native_libs\release\out\lib
note that 3 folders exist inside
arm64-v8a
armeabi-v7a
x86_64
Select this 3 folder and create a .zip file. Name doesn't matter.
[PLEASE NOTE THAT I HAVEN'T COMPRESSED THE ./lib FOLDER]
Upload this new *.zip file as Symbol File.
.
If talking about Flutter, looks like the Flutter team needs to change some source files for the NDK, because it does not see where from to generate debug symbols.
Here is an issue thread: https://github.com/flutter/flutter/issues/60240
Setup steps are so:
Pre-condition: Intall Android studio 4.1+ and Gradle 4.1+
Install NDK (Side by Side) in SDK manager
Write path to NDK in local.properties
Add in app/build.gradle (last line) android.buildTypes.release.ndk.debugSymbolLevel = 'FULL'
Before you can upload debug symbols files, you must be using Android Gradle plugin version 4.1 or higher.
Looks like it will come only with Android Studio 4.1, because I can only get Gradle 4.0.0 automatically now.
So I suggest you to return classic Play console and it will let you through :)
UPDATE:
So just use an updated Gradle and add NDK debug symbols to the build now
The Answer was given by Shakle will be not useful as per the following message on Play Console.
The old version of Play Console will be discontinued from November 2,
2020 You’re already using the new Play Console, so you don’t need to
do anything. A few features are going away if you want to check them
one last time.
It's just a warning, nothing else. Just go ahead.
If you don't want any warning, Go to this link and follow the steps:
https://support.google.com/googleplay/android-developer/answer/9848633?hl=en
You can use the new version of the play store as it is.
you can make these zip file by go to build\app\intermediates\merged_native_libs\release\out\lib inside your Flutter project
and compress the folders into symbols.zip, now upload it into the google play console
I had a similar problem.
What really helped me:
Make sure your Android Gradle plugin version is 4.1 or later.
Install NDK (Side by Side) in SDK manager.
Install CMake in SDK manager.
Add
ndkVersion <ndkVersion>
ndk {
debugSymbolLevel 'FULL'
}
to app/build.gradle
My final build.gradle:
...
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.example.app"
minSdkVersion 21
targetSdkVersion 30
versionCode 28
versionName "1.0.59"
ndkVersion "23.1.7779620"
ndk {
debugSymbolLevel 'FULL'
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
configurations {
compile.exclude group: 'com.google.zxing'
}
}
...
I hope this will help you and save you time
If you want to solve this warning error:
This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug. Make sure also to install CMake
This will happen if your gradle version is higher than 4.0
Place this code into your build.gradle file
android {
compileSdkVersion 28
defaultConfig {
applicationId 'com.example.myproject'
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
ndk {
debugSymbolLevel 'FULL'
}
}
Instead of creating and uploading zip files, you can include the following to your app\build.gradle file:
buildTypes {
debug {
// This is just here for local testing and is optional.
firebaseCrashlytics {
nativeSymbolUploadEnabled true
unstrippedNativeLibsDir file("build/app/intermediates/merged_native_libs/debug/out/lib")
}
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
}
release {
// ..
firebaseCrashlytics { // Insert this
nativeSymbolUploadEnabled true
unstrippedNativeLibsDir file("build/app/intermediates/merged_native_libs/release/out/lib")
}
ndk {
// replace with 'FULL' if you need more info,
// but note that it will increase the file size of your appbundle dramatically.
debugSymbolLevel 'SYMBOL_TABLE'
}
}
}
Here is some documentation for reference:
https://firebase.google.com/docs/crashlytics/ndk-reports#upload-symbols-external-dependencies
And if you're unclear about how to set up automatic uploading of native symbols, try adding this:
buildTypes { ... } // Your build types from the above snippet.
tasks.whenTaskAdded { task ->
if (task.name.startsWith('assemble') && task.name != "assembleReleaseAndroidTest"
&& task.name != "assembleDebugAndroidTest") {
String taskName = "uploadCrashlyticsSymbolFile" + task.name.substring('assemble'.length())
task.finalizedBy taskName
doFirst {
println "Running Gradle task '$taskName'..."
}
}
}
More info for building gradle tasks here:
https://docs.gradle.org/current/userguide/tutorial_using_tasks.html
Also, ensure that you have NDK and CMAKE installed in your IDE's SDK Manager.
Hope that helps!
Simple approach, go to \build\app\intermediates\merged_native_libs\release\out\lib , you will find 3/4 folders , zip those , upload this ZIP from release option ( upload Symbol File ). Warning will be gone after bundle review.
For fixing it in the Visual Studio Code: you should first download
the NDK from the android's website.
Extract the zip file to a folder named ndk and place it under your - already installed - Android SDK folder. Like this: Android/sdk/ndk
Then open app/build.gradle.
Under the Android section. Add ndkPath property as follows: ndkPath = <ndk-dir>
app/build.gradle ndkPath property
At the end of app/build.gradle add android.buildTypes.release.ndk.debugSymbolLevel = 'full'
The next appbundle, built by flutter build appbundle command should not give any errors on the play store about native debug symbols.
a more thorough explanation is here
I just upgraded ndk from 21.4.7075529 to 22.1.7171670, and now I get the debug symbols.
I'm using com.android.tools.build:gradle:7.1.1 and React Natvive 0.69 BTW.
I have the exact same issue.
Possible solutions:
Use the Google classic Play console
Gradle 4.1 is now released with Android Studio 4.1
Could not get unknown property 'android' for project ':app' of type org.gradle.api.Project.
You have to add it in gradle.properties not build.gradle
I was able to get Flutter to build native debug symbols using Android Gradle Plugin (AGP) 4.1.0, installing corresponding NDK version and adding the appropriate config to android/app/build.gradle on macOS (but it should also work on Windows/Linux).
Optional: Run flutter build appbundle and take note of the .aab file size
Check what version of AGP you're using in android/build.gradle by looking in dependencies e.g. com.android.tools.build:gradle:4.1.0 is 4.1.0
Check which version of NDK you need. Assuming your AGP is 4.1.0 the NDK version you want to install is 21.1.6352462 (for other AGP versions check mappings here)
Install specific NDK version using Android Studio. Alternatively you can use sdkmanager and the CLI: $ANDROID_HOME/tools/bin/sdkmanager --install "ndk;21.1.6352462"
In android/app/build.gradle, under android.defaultConfig add ndk { debugSymbolLevel 'FULL' } aka set android.defaultConfig.ndk.debugSymbolLevel = 'FULL' as per this
Run flutter build appbundle. The .aab should now contain native debug symbols and be larger than the previous build in step 0
Troubleshooting: If you get any errors around CMake I didn't explicitly install it but you might need to, especially if you're using Windows, and you can do so using Android Studio.
screenshot
My issue was this:
This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug.
Fix successfully just upload native debug symbols from the image reference directory shown.

Error: Please select Android SDK in Android Studio 2.0

I am using Android Studio 2.0 Beta2, and i am trying to run old project that uses google maps api v1 (package com.google.android.maps) as *.jar file. To run this old project i need specify compileSdkVersion older than the last one (23). I used
compileSdkVersion 'Google Inc.:Google APIs:17'
But i got Error: Please select Android SDK error in Android Studio. How i can run this old project with older compileSdkVersion?
Open gradle.buld in your app module
change versionCode or versionName and sync.
Also just sync the project from the tool bar
the easiest way is to:
Tools -> Android -> Sync Project with Gradle Files (Android Studio 3.0.1)
With Android Studio 2.1.3, I got this message when trying to launch my app.
I used the Module Settings dialog in AS to select another compile SDK version. Then I went back to the same dialog and chose Google API 17 again.
Then AS accepted the settings and could launch my app.
Really weird, as the contents of the build.gradle file is identical to what it was when I had the error message.
I could fix the problem in my case you need to set the compileSdkVersion and the buildToolsVersion manually in the android studio. I don't know why the android astudio doesn't recognize the value from gradle.
So the steps are:
File/Project Structure/Flavors/
and set the buildToolsVersion and compileSdkVersion.
But you need to check, because the android studio puts this value at the end of the gradle file and if you have replicated this variables, the gradle build make an error. So I make cut and paste in here
android {
defaultConfig {
compileSdkVersion 22
buildToolsVersion '22.0.0'
minSdkVersion 15
targetSdkVersion 22
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionDevel
versionName "${versionMajor}.${versionMinor}.${versionPatch}.${versionDevel}"
multiDexEnabled = true
}
and that's it!
It is works for me
intelliJ IDEA 13 error: please select Android SDK
My Problem: "please select Android SDK", But everything is okey :( -> I think one of IntelliJ file was crashed (after blue screen of death)
My resolution:
File -> Settings -> Android SDK -> Android SDK Location Edit -> Next, Next (Android SDK is up to date.), Finished
... and crashed file was repaired!
I hope this will help!
I just went to my Gradle button on the far right of the screen on the side and refreshed it and it worked for me.

Android Studio 0.2.13 missing dexFile

I am using Android Studio, and have updated it to the latest Version 0.2.13. My problem is that I am not able to debug my project anymore. The error I get from gradle:
“Gradle: A problem was found with the configuration of task ':AdcSampler:packageDebug'.
> File 'C:\ArneTFS\AndroidStudio\AdcSampler\AdcSampler\build\libs\AdcSampler-debug.dex' specified for property 'dexFile' does not exist.”
And, I have checked, the file is not there! I thought the result of packing the file into Android format should produce the dex file in that path?
My projects used to work before I updated to the latest version. I have tried to uninstall Android Studio and installed an older version. But, now that didn’t work either. Yesterday, it suddenly started to work again, by magic. I could even update to latest version (0.2.13), and everything was fine. So I happy went to bed, but when I tried to run my project this morning, then it had stopped working?!
So now I have tried to generate the most simple project, using just default values. Compiling works fine, but when it comes to making the .apk file in the Gradle packageDebug task, then I get the same error message as shown above.
Beneth is my gradle file:
Any tips?
Regards Arne
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 18
buildToolsVersion "18.1.0"
defaultConfig {
minSdkVersion 18
targetSdkVersion 18
}
}
dependencies {
compile 'com.android.support:appcompat-v7:18.0.0'
}
I had the exact same problem. I spent several hours searching for solutions, all that is written here Android Studio new project can not run, throwing error didn't help me.
But I found what my problem is - the environment variable USERNAME. I think, apparently, the installation of some software changed my USERNAME variable from JOHN to SYSTEM. You can check it out as:
echo %USERNAME%
in command prompt.
I changed the USERNAME and oops! - BUILD SUCCESSFUL!
Hope, this helps.

Resources