Infinite app closing issue in android studio - android-studio

I have just changed the package name in the android studio, and also replaced the new google-services.json file downloaded from the firebase console to configure the new package. After these changes, the application is installed properly on the emulator but it is displaying just a white screen and not moving to the splash screen. Even, It is not going to Launcher activity, I have tried to debug by putting the breakpoints. In the logcat of the android studio, it seems it is closing and opening in infinite ways. I have also attached the screenshots here.

Related

Editor Opens main.dart on Save

Have a flutter web project being developed using Android Studio and something has changed recently which is now causing Android Studio to open up the file main.dart in the editor pane whenever a file is saved while the project is running in chrome.
Say the project is made up of two dart files: main.dart and example.dart and I have only the file example.dart open in the editor. I then click run 'main.dart which causes the application to launch in chrome browser. If I then make a change in example.dart while the app is running and save the file, the main.dart file is automatically opened in Android Studio's editor pane and gets the focus. This is forcing me to have to switch back to the example.dart file each time I want to make another change to it.
Not sure if it is Android Studio doing this or flutter itself as part of its hot reload functionality. Or maybe something I clicked on by mistake making it do this?
Did a flutter upgrade and the issue has now gone away so maybe the problem was somewhere in flutter web's Hot Reload functionality.

"Unable to locate adb" using Android Studio on Windows 10 to develop Flutter apps

Android Studio upgraded to version 4.0.1, and now I get a "Unable to locate adb" message when trying to launch an Android emulator image from the AVD manager, in order to run/debug a Flutter app. I have tried all the obvious things, e.g. checked to see that there is an adb.exe image at .../AppDate/Local/Android/Sdk/platform-tools. I have even tried de-installing completely and did a clean install of everything from scratch. I have plenty of disk space, anti-virus has not quarantined it. Interesting, if I start a native Android app (e.g. "basic activity"), then the message goes away and the image starts OK
Android Studio - launch emulator AVD - "unable to locate adb"
Visit the above link to get solution in detailed way with pictures.
I had the same issue as you were facing, I have Researched the Whole Internet but found nothing useful. So, I somehow figured out the problem and fixed it, The problem is at
app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Whenever we create a new project due to some reason the Module SDK is not set up automatically. Thus the ADB manager was throwing an error 'Unable to locate AVD', which is not that fatal as the error/warning is not stopping us from launching /starting the emulator, but it is so annoying to see that pop-up box. So here is my simple and quick fix.
Solution:
Click on the project folder, tap the dropdown icon just beside it.
Now Navigate to the path below.
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Now Click on the file GeneratedPluginRegistrant.java to open it.
Once it is open, At the Top you will notice a bar that says 'Module SDK is not defined',
Now right against it, you will also see a hyper-text named 'Setup SDK', Just Click on it.
That will open a Pop-up Box with the title 'Select project SDK'.
Now select the Android Platform API and then click OK. After that being done Restart your IDE.
Your Problem will be Solved. And you will also notice that Emulator Opens up way faster than before.
NOTE:
The Above Steps has to be performed with every new flutter project.
I have already answered to your question before to Read more and understand in detail with pictures just visit the link
Android Studio - launch emulator AVD - "unable to locate adb"

LogCat is absent in Android Studio at not Android Studio project

In the context of IONIC based application, I am developing a Native Cordova plugin for Android. I opened the Android prepared and run the application by Android Studio successfully. But I see that LogCat has gone away from everywhere: menu, actions ... But it is working for the bare project generated by Android Studio. And I reuse it. But it weird. I see that LogCat is not tangled to the project. It has to be available everywhere. I need it. I've attached my plugin and I do not see my notifications tagged. It is the issue of the next question ...
Regards.
I am not sure if I understand your question, but if you need LogCat, but your IDE cannot display it, you can always use a simple temrinal/command line for it:
adb logcat
this command will give you a tailed logcat in your terminal.
Just to make sure: The logcat is generated on the mobile device! Not on your computer! Android Studio is reading it from the device to show it.
If Android Studio is not showing it, you can either try to hide/show it using the Alt + 6 shortcut or you can try reconnecting your device by:
either just pulling the USB cable and reconnect it
or restart the adb server with the two commands adb kill-server and then adb start-server
or by clicking on the restart icon in the Logcat window of AndroidStudio (see image attached)

App in Android Virtual Device continues to stop working

Extra context: using LibGDX engine in android studio. Updated android studio today and avd no longer works.
After I build my project and run the AVD the app crashes. I have gone into settings and tried to open the app from there which occasionally opens up the app and then promptly crashes (and the screen will pop up with a message that says the app keeps stopping - screenshot attached). Additionally, I get this error: Emulator: Started GRPC server at 127.0.0.1:8554 - which I have checked through the following stackoverflow links but have struggled to fix the issue still. I have searched through stack overflow and have tried:
cleaning the project and rebuilding it
restarting android studio and then rerunning the code
restarting the avd
creating a new avd
updating SDK tools (though I am uncertain if I have the right tools installed, will attach image of what I have installed)
updating android studio (running version 3.6.1)
invalidating caches and restarting (after deleting the app off of the emulator, and after reinstalling
the app on the emulator)
For context, I was looking at these stack overflow posts and have tried the suggestions that I mentioned
above, but I could have missed something:
Android Studio cannot find cerfile, emulator doesn´t start
Why do I get this GRPC Error "WARNING: EmulatorService.cpp:448: Cannot find certfile" when I start the emulator?
GRPC Server error while running andoid app on emulator
Error type 3 Error: Activity class {} does not exist
Any help would be appreciated, and I would be happy to edit and provide more information if needed!
This is the snapshot of the error in the AVD mentioned above.
This is a link to the picture of the SDK tools installed on my computer.
SDK Tools installed
Edit:
I tried a new android studio project without LibGDX and the AVD worked fine.
I've followed this video for the setup of my LibGDX project: https://l.messenger.com/l.php?u=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dp_hp6vMeewQ%26list%3DPL6gx4Cwl9DGBsvRxJJOzG4r4k_zLKrnxl%26index%3D70&h=AT2_tH6gq08lg9Xnl0q0C6DJ5bnjySsbAvu0KmR9Jr6m8g8xGLzK5k39bMl5jdpQgFYHQcnd6t_rqixKPG6pTO1gYzPoBMN1MC_qzF8jUqtQITrsA-gU46c9zLHt90nZY8_ACbeRK33DmDvfGGQrYA
I've followed this video series for the tutorial I am working on - the AVD broke on this video: https://l.messenger.com/l.php?u=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dp_hp6vMeewQ%26list%3DPL6gx4Cwl9DGBsvRxJJOzG4r4k_zLKrnxl%26index%3D70&h=AT2_tH6gq08lg9Xnl0q0C6DJ5bnjySsbAvu0KmR9Jr6m8g8xGLzK5k39bMl5jdpQgFYHQcnd6t_rqixKPG6pTO1gYzPoBMN1MC_qzF8jUqtQITrsA-gU46c9zLHt90nZY8_ACbeRK33DmDvfGGQrYA
So the links I posted and what I tried (cleaning the project, deleting the app from the emulator and invalidating caches and restarting android studio) actually do work.
The problem was that android studio did not understand my .tmx file (the file that will provide the map for my app) for some reason.
I realized this after clicking on the tmx file, as android studio displayed a prompt about downloading dependencies for the tmx file. Then all I did was download the suggested dependencies and then cleaned, deleted and invalidated/restarted and the AVD worked.

Android Studio won't run application from studio ide?

I've got an application I've been working on and am having an issue with android studio. When I click "build->run" and then select my device, the application never runs on my phone (and the log in android-studio that automatically comes up does not have anything, whereas in the past when I have used this feature it usually says something like, "waiting for phone..." and then the application pops up and automatically opens on the phone and you get some other pertinent information). I have the phone already in developer mode with the install from unknown sources set to on. When I manually move the application from its gradle build location to the phone and then install it manually in file explorer, all is well and the application performs as expected. As I need to debug, however, this is not a very viable solution. Anybody have any advice as to how to get it to run from the IDE? I have tried rebuilding and invalidating the cache/restarting android studio, to no avail.
When I click the run tab at the bottom I have an empty window. When I click the debug tab, I see:
Waiting for device.
Target device: samsung-samsung_sm_g920a-randomIntegerId
Uploading file
local path: /home/eric/Documents/class/OOSE/final_project/2015-group-17/project_code/android/Place2B/app/build/outputs/apk/app-debug.apk
remote path: /data/local/tmp/oose2017.myApp
Note: I am building the application on a LUbuntu 15.04 VM on a windows 8 host, and am using the latest version of android studio.
EDIT: gradle console indicates a successful build as well (obviously since moving the .apk manually to the device works properly).
Open 'Run->Edit Configurations...', and look for your app module in the column on the left-hand side.
Select it, then go to the 'General' tab.
Under the 'Activity' section, there are a couple of radio buttons. Make sure that 'Launch default activity' is selected.

Resources