error running my .apk file android studio - android-studio

hye.. I'm creating an app using android studio. My app (android 4.4.4) consist of webview activity and works fine until I added fullscreen activity. When i tried installing the .apk file in my phone, app crashed after the splashscreen activity runs.
Then i tried to create new project excluding the full screen activity which i copied my previous code. I run my app (4.4.4) in android virtual device and it works perfectly but when i generate the .apk file then install it in my phone, app crashed, still the same problem. I'm using samsung ace j1. I just couldn't get it.
Can you help me sort this thing out? I'm still a newbie.

Related

Android studio Gradle Build Running stuck, desktop app, How do i get it to complete the build?

I have created a default project with libGDX and imported it in android studio
i have not even touched the code and it is the default template that libGDX creates.
When i run it on android virtual device it works fine and displays a red screen and badlogic logo.
Problem occurs when i try to run the same thing as a desktop app.
when i click run, the app runs and displays the red background with badlogic logo however, Gradle Build Running is displayed in android studio status bar and it never completes, meanwhile the app is running image of what im talking about
Then when i stop the app i get the following error
Execution failed for task ':desktop:DesktopLauncher.main()'.
Build cancelled while executing task ':desktop:DesktopLauncher.main()'
How do i get gradle to finish the build for desktop app? if i run it on android emulator the build completes successfully in less than 10 seconds
More details:
in the edit configurations i have set the
main class to: com.packagename.desktop.DesktopLauncher
working directory: pointing to android assets
Other than that i haven't touched anything else. I've been searching the internet for the answer for hours and haven't found my issue. Thanks in advance for any clues to what is causing this. All the best :)

Android Studio recognises device, but not able to run code

I am using an old smartphone as a device to run my app on in Android Studio. I recently switched to a new computer, so I reinstalled AS on that computer according to the docs. Android Studio recognises my device, but I'm nota ble to run my (Flutter) app on it, and the name of the device is marked with a small green dot.
I'm not entirely sure if that was the problem causing this, but AS said that my Dart SDK was not installed. After installing and restarting, I was able to use a device to run my Flutter app.

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.

Not able to run Emulator using the Android studio for my Flutter app, getting NO CONNECTED DEVICES error

Please Note: I tried several available solutions but none worked for me since yesterday hence posting this. I have also mentioned below what are things I have tried so far.
I am new to Android Studio and Flutter application and I am trying to build a simple Flutter app using the Android Studio.
I have downloaded and kept my flutter files in C:\src\flutter. Also added to Environment variables.
I have installed the Android Studio and also installed the Flutter plugin with the Dart.
I created the Virtual Emulator Device using the Tools->AVD Manager and choose the Nexus 6 with the Android 8.1
Created a simple project using the File->New Flutter Project->Flutter Application.
When I try to run this application I get the following error:
As you can see in the screenshot it shows that the No Devices in the emulator section not sure how to run it.
Things I have tried so far:
If I run flutter doctor then I get a tick for all the things except Connect Devices. My guess is that it is obvious because I have not connected any external device but using the emulators.
I tried to create the emulators using the command flutter emulators --create Nexus_6 and tried to launch it using the command flutter emulator launch.
I tried running the Android studio as an Administrator.
Restarted the system several times.
My adb.exe was crashing so updated the windows and replaced it with the new adb.exe as mentioned in one of the solutions.
My flutter emulators show following list in the command prompt:
I tried checking the folder in Appdata -> Local seems to be fine as per other mentioned answers.
When I run the Emulator using the AVD Manager from Android Studio I see that it is firing up the Android Emulator but it is not responding. In addition to this, I also observe in my task manager that process adb.exe(32 bit) is running whereas my WINDOW 8.1 is 64 bit. Is this expected?
I am not sure If I missed something here. Please help me on how to solve the issue.
Using below command on Flutter worked for me:
flutter config --android-sdk [android-sdk-path]
The path is usually C:\Users<username>\AppData\Local\Android\sdk
this path can be found from android studio - SDK manager also.

Why Android Studio does not run App in Android mobiles after gradle update?

When I start running my app, it was loading and running on mobile phone normally.
but after installing android SDK Build-tools 23.0.1 and google USB driver I can't run the app at all.
I mean when I press Run Icon from Android Studio no thing happened or load to my mobile.
Just all process are shown in attached image.
It looks like you've ran the Gradle help task.
You need to run one of the install tasks.

Resources