Android App is not running on other devices - java

I just made a simple android app with 2 buttons. Each button onClick opens a new activity. I installed the app on my device via USB cable from Android studio and it runs fine on my device.
But here rises the problem, when I installed the app on my friends device after sharing via SHAREit the app installed on his device but did not run.
What could be the reason for this? And how can I solve this?
Please help. Thank you

This issue is most probably due to the Android instant run features. Try the following steps to get this working,
Step 1: From Android Studio, click on Build => Build APK. Once the build is complete, you will see an option to view the APK in explorer. Copy the app-debug.apk to a folder of your choice.
Step 2: Open a command line. Switch to the folder which contains app-debug.apk. Run the following command to install your APK on phone,
adb install -r app-debug.apk
Step 3: From your phone, use Share-it to copy the APK to your friend's phone. Now the app should run.

This is happening sometime, when do some changes in app configuration/ gradle by unknowingly,
DO THIS THING FOR SOULUTION:
Close Project in Android Studio.
Close Android Studio completely.
Rename your Project name.
Open Studio and import Project
Clean and Try to Run

Related

I Build apk of my android project. Apk also build successfully. but when i try to install apk in my phone its not installing and showing error.?

This file does not have an app associated with it for performing this action. please install an app or, if one is already installed, create an association in the default apps setting page android studio build Apk this file does not have an app associated with it for performing this action. please install an app or, if one is already installed, create an association in the default apps setting page.
Make sure that your instant run is enable or not? If so then i had similar experience and i solved by disable instant run as follows.
If you are sure that the apk is build, check whether the file is having the apk extension (appname .apk ).
Better way is to let Android Studio install it for you instead of building apk and manually installing it:
Enable 'USB debugging' from you phones 'Developers Options' .
Connect your Phone to your PC and Click on 'Run' app option in Android Studio.
Select your device from the popup window.
If there is any already installed app, or any internal errors, Android Studio will take care of it.

I can't build and run my app without usb debugging

I'm requesting your help because I've made an app on Android studio, which works fine on my phone with usb debugging.
I tried to build the unsigned apk with gradle but it won't install and my phone says that "the package must be corrupted" when I try to install it. I also managed to install a debug version apk on my friend's phone, it installed but kept on crashing regularly and was unusable.
I probably have wrong settings in my project, but I'm new to this and don't really know what to do.
Thanks for your help
Goto Build Option->Choose Build APK(S) and then generate debug APK and that APK you can install in your device

My app is not running on another device

I recently made a simple android app .Its working fine in my device but not running on any other phone when i share it via SHAREit or other means. I have already disabled Instant Run and I am currently working on API 22(Lollipop) and have tried it the phones with higher API's such as API 23 (Marshmallow). Can anybody please fix it. Thanks in advance.
Debug apk that is installed to the phone by Android studio will always gets some error when shared using SHAREit and similar softwares.
Bulid -> Rebuild Project
Bulid -> Build apk or Generate signed apk
Try sending the newly generated apk.
Go to build options in toolbar and click on build APK. After that use that APK it works in all devices.

Exported APK works fine. But via USB debugging not working

When I export my Android application as APK and install it in the device it is working properly.
But if I try to launch the same Android application on Device via USB Debugging mode, I'm getting following error:
Installation error: INSTALL_FAILED_VERSION_DOWNGRADE
I'm using Google Play Services, v7 Appcompat with my application as library project.
I've set the Custom Debug Key (the same key which I used while exporting) as explained in this post.
Any suggestion what might be wrong?
Solution 1:
It means you're trying to install an app with the same packageName as an app that's already installed on the emulator, but the one you're trying to install has a lower versionCode .First uninstall your application from the emulator:
adb -e uninstall your.application.package.name
Then try to install the application again or increase the app version and try again.
Solution 2:
May be your package is the same as the default package name. So change and try it.
Solution 3:
Did you enabled Multiple account on your device (and push your apk via ADB)? If so you have to remove the apk in every account. After complete uninstall, your push will be OK.
Solution 4:
Check your activity class. It may be wrong.
Was answered here. Basically your new version, that you try to install via debugging has a lower version number, than the version, that's already on your phone.

Android SDK and Eclipse Virtual device not launching

I have just installed eclipse with the andriod sdk. I have completed all suggested steps. When I attempt to launch the Emulator widows returns emulator arm stopped working can anyone help me with this I cannont test my .apk without it as I do not have an android device.
Have you created a virtual device or the emulator. m guessing u have not.
Start AVD manager,u can find it in the same folder where the 'android sdk manager' resides.
Choose the create new option and create a emulator. This will create the emulator and the applications that you write on eclipse will run on this emulator.
Note : the emulator will take a few moments to run, the first time. So don assume that its not working.

Categories