Android Studio does not install app after using the Internal Test Track version - android-studio

I've been working on my app for a while now and recently uploaded it to the Google Play Console's Internal Test Track. I installed my app via Google Play Store and it worked fine.
But if I now try to install an updated debug version via Android Studio directly it just launches my main activity without installing the changed app.
What I've tried:
Uninstalling app and running in via AS: "Error: Activity class {...} does not exist."
Restarting phone
Restarting AS
Reconnecting phone
Uninstalling app via AS (gradlew uA)
Uninstalling app via app manager
Invalidating AS cache
Cleaning / rebuilding project
Disabling Skip installation if APK has not changed in Run Configurations -> Miscellaneous
Increasing version number
What may cause it:
The Internal Test Track version is signed, but the key is kept by Google
The app is not selected as 'App to debug', but the dialog to choose one, does not offer it
How can I install my unreleased version via Android Studio directly again?
Thanks in advance. -Minding

QUICKFIX
The "Gradle Aware" task was missing for some reason. To fix it "Run" > "Edit configurations" > "+" > "Gradle-aware Make" > "OK" (leave the field empty) and restart.
The Android Studio team is still investigating why this happened.
Old answer / Workaround
Using the ADB to directly uninstall the release version and installing the debug version worked, but you have reinstall the app for every change! A better solution would still appreciated.
Build your project's debug APK
Enter the following into the terminal:
adb uninstall MY_PACKAGE_NAME
adb install -r ./mobile/build/outputs/apk/debug/mobile-debug.apk
If you get "adb" not found. use %LOCALAPPDATA%\Android\sdk\platform-tools\adb instead.
Select the app to be App to debug in the device's developer options.
Hope this help. -Minding

Related

Problems with launching the physical device in android studio

After i connect the device onto my android studio yet, then when I running and build Its return the code
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_VERSION_DOWNGRADE
List of apks:
[0] 'D:\MyApplication\app\build\intermediates\apk\debug\app-debug.apk'
The device already has a newer version of this application.
in the editor
I try to fix this things with some article in this site but nothing working else
In the corner of screen it has this too that i dont know what is it exactly of meaning:
failed to commit install session 495050153 with command package install-commit 495050153 .Error:INSTALL_FAILED_VERSION_DOWNGRADE
So,this is the problem when running
and
after click Ok then its getting error thiss
, and also I when open tab running devices its still apppearing just only run this debug then its get this error
.Thank you for helping me this problems
You can uninstall the application from your device first and then install the fresh one .

Android studio is giving the following error when I am trying to build a ionic project "Gradle sync failed: Sync failed: reason unknown"

I am trying to build a ionic project in Android studio on Ubuntu 20.04 . I am using the command ionic capacitor build then android studio opens up as expected then it shows this error Gradle sync failed: Sync failed: reason unknown. I am unable find a solution for this particular gradle sync error. I have reinstalled Ubuntu and other things but still the problem persists.
In my case, a fresh install of Android Studio resulted in Android 31 being the only SDK available but the project was targeting Android 30. I went to Tools > SDK Manager and made sure the appropriate version of Android SDK was installed and available. After restarting, and allowing the gradle sync to complete I was able to build/run the app on a virtual device, etc.
Here is what I found
This is the screenshot thanks for helping.
Capacitor lets you manage your own Android project. Like any IDE-backed project, sometimes things get so out of sync that the only solution is to rebuild the project.
To do this, follow these steps:
Copy any source code you created (such as Java files in app/android/src, manifest files, or resource files) into a safe location outside of app/android.
Next, make sure you are running an updated version of the Capacitor CLI:
npm install #capacitor/cli#latest
Remove the android directory:
rm -rf android/
Re-create the Android app from Capacitor:
npx cap add android
Copy your saved source files back into the project.
Check the error log. You should find something like "Module: 'mobile' platform 'android-30' not found" or something similar. Click Tools > SDK Manager and download the appropriate Android SDK Platform package.
on top right you will see option to view log file upon clicking there you will redirect to file manager and open idea file there
example :
open idea file and scroll down you will see actual issue.
In my case android sdk 31 was not installed.
I installed android sdk 31 from File>Settings>Apprearance and behaviour>system settings>android sdk and install required android sdk and rebuild the project.
accord to my observation in most cases you get this error because you have not required sdk installed in your system.

I try to make android studio (emulator) work with vs-code but have an error "avdmanager is missing from the Android SDK"

This is my PATH
export ANDROID_SDK_ROOT=/mnt/sda1/DevTools/sdk/
export ANDROID_HOME=$ANDROID_SDK_ROOT
export PATH=${PATH}:/mnt/sda1/DevTools/sdk/platform-tools
I try many cases, but still this error!
Try :
flutter doctor --android-licenses
if something wrong, try to locate android sdk path.
flutter config --android-sdk {path}
Mine :
flutter config --android-sdk C:\Android\Sdk
This worked for me. If you have sdkmanager, avdmanager and emulator, and you have them in your PATH environmental variable, then
Download a system image:
sdkmanager "system-images;android-30;google_apis_playstore;x86_64"
(you can find available packages with sdkmanager --list --verbose)
Create a new virtual device with
avdmanager create avd --name MyAndroidDevice --package "system-images;android-30;google_apis_playstore;x86_64"
Start the emulator
emulator -avd MyAndroidDevice
Now restart VSCode and open your Flutter project. The new device should be at the bottom right corner or you should be able to choose it by clicking on "No device".
For me, I had to restart my VS Code for the installation of Android SDK be reflected upon it.
I know this is an old question but setting my $PATH variable in ~/.bashrc (I'm on Ubuntu 20.04) did not work for me.
I needed to setup Android Emulator for VScode, because I wanted to run my flutter app, which seems to be the same issue as OP had.
Instead of setting the $PATH directly you can actually use Flutter in the terminal to do it.
If you run "flutter config" in the terminal you get something like:
Configure Flutter settings.
To remove a setting, configure it to an empty string.
The Flutter tool anonymously reports feature usage statistics and basic crash reports to help
improve Flutter tools over time. See Google's privacy policy:
https://www.google.com/intl/en/policies/privacy/
....
Run "flutter help" to see global options.
Settings:
android-sdk: <my_path_to_android_tools>
Analytics reporting is currently enabled.
You can then see the $PATH that is currently set with flutter under:
Settings:
android-sdk: <my_path_to_android_tools>
Mine was incorrect so I changed it to the current one with the command:
flutter config --android-sdk <my_path_to_android_tools>
Afterwards I restarted VScode and when it was finished loading I could now press the "device" button in the right hand corner and then select emulator that I had already created. I used one of the above answers to install the emulator itself.
It took a while to launch the emulator the first time due to installing some dependencies but it did work!
I tried this and works:
from terminal run flutter config --enable-android. You will get Setting "enable-android" value to "true".
after that open android studio, set up virtual devices first if you haven't. Open Android Studio -> Configure -> AVD Manager -> Create Your Virtual Device
Go back to your VS Code, open command Palette (Ctrl+P or cmd+P, then type >), or from View -> Command palette... -> Flutter: Select Device -> choose your android device
I faced the same issue and solved it running flutter doctor from the terminal, in VS Code. In my case, I had the android sdk located in a custom location (D drive), the reason why it wasn't found automatically. The "doctor" told me to run flutter config --android-sdk <my-sdk-custom-location>. Running it and restarting the IDE made the trick. Hopefully this helps someone facing the same problem.

Android Studio 3.6 : Unable to run apk on emulator or device

After Updating Android Studio to the version 3.6, I am unable to install an app directly to device by using Run button.
It just updates the gradle and shows gradle updated popup that's it.
I tried invalidating cache and recreating the emulator device but no luck yet.
Let me know if anyone could help as am creating APK and installing it manually in emulator.
I have installed the Android Studio 3.6 and suddenly existing project stopped running. I tried the following thing and it worked.
Android Studio -> Run -> Edit Configurations -> Installation options -> Select Nothing instead of Default apk.
I am not able to post this as comment, but maybe someone finds this info useful.
I faced same problem after updating Android Studio to 3.6.1 on Mac OS.
I tried to use gradle task for installing and launching my application and I found strange log in console about missing adb in platform-tools folder.
So, as result: after update folder platform-tools was moved into folder with same name (was: sdk/platform-tools become: sdk/platform-tools/platform-tools). I just move it manually back and everything is worked as a charm.
Hope it helps.
I have installed Android Studio 3.6 yesterday. I have tried both way to install APK.
Directly by Run button. [DEVICE - Working, Emulator - Working]
Generated APK, Drag and Drop to Emulator. (Its also working)
Hope It will work for you too. Just drag n drop APK file to emulator.
Bonus - May your emulator is older, You can update your Emulator from
SDK Manager and Create New.

"APK was defined multiple times" , app fails to install with Android Studio

My app was installing just fine... installing and reinstalling for testing, etc. But now it won't install anymore... and Android Studio says,
Application Installation Failed
Installation failed with message Failed to
finalize session :
INSTALL_FAILED_INVALID_APK: Split
lib_slice_3_apk was defined multiple times.
It is possible that this issue is resolved by
uninstalling an existing version of the apk if it is
present, and then re-installing.
WARNING: Uninstalling will remove the
application data!
Do you want to uninstall the existing
application?
[CANCEL] [OK]
I tried uninstalling the app from my phone, but it still won't re-install.
Also, I tried installing it fresh on an emulator where it had never been installed before, and that did not work either.
I suppose I must have inadvertently messed up some compile-related setting that I don't understand (but I haven't been doing anything like that). I don't have a knowledge of the compile process, and pretty much depend on Android Studio to do that.
I have been working on a "sister" app to this one... where I copied some libraries (.jar files such as zixng.jar from [project root]\app\libs) from this app to the other app. And that other app is installed on my phone also... but then again, it's not on the emulator... so I guess that's not the problem. Merp.
Thanks for any suggestions or possible explanations.
Try to clean & then Rebuild the project again. To do so please go to Build menu, both the tools are present their.
If issue not solved with that than try to invalidate caches & restart Android Studio from File menu -> Invalidate Caches/Restart.

Resources