React-Native build App on Emulator works - real device not - android

If I build my App it works on my Android Emulator. If I use my real android device ( Samsung Galaxy S7 Edge) it also build, but uses an old version of my app. On the Emulator the newest version is always deployed. Do you know why? I don't get an error or sth. I want a debug apk.
I already tried to unistall the old version.
I already tried to ./gradlew assembleDebug
Thank you for your help

If you are executing the debug version on your device (not bundling for release) then that is expected.
You need to "shake" your device in order to enter the RN dev menu and choose refresh. That should trigger the on demand bundling again.
If this is not the case, then please post your errors, code, logs, etc.

Related

Android Studio not installing app on device, no error messages

I have a clean Android project on Android Studio (just with a "hello world' screen), and I'm trying to install the app on my Samsung Galaxy S10e.
I click the Run button, and this is what I see in the Build Output:
And the apk is generated successfully.
But it's not launched and not installed on the device (no icon, and it doesn't appear in the apps list).
When I try manually installing the apk by adb install app-debug.apk, it works. The app shortcut appears on the device, it's added to the apps list, and I can launch the app.
At first also adb install didn't work, giving out the error INSTALL_FAILED_TEST_ONLY, but I solved that by adding android.injected.testOnly=false to gradle.properties.
I tried changing Gradle version to 6.0.1 (looks like this is the latest at the moment), and it didn't help.
I also have my device selected at the top:
How can I make Android Studio install and launch the app on my device?
Android Studio version: 3.5.3
Edit:
I'm seeing the same behavior on an Emulator. I opened AVD from Android Studio and chose Pixel 3A. The emulator opens up, I run the app, nothing happens on the emulator (and I see the same Build Output messages).
The same happens to me. It is probably a bug in Android Studio. At the second compilation the app installs correctly. It is tedious.
There isn't enough information to find the cause of this issue.
But since it works with adb, it means you run adb command. There could be only one instance of adb daemon running. So if it's involved externally my guess is Android Studio won't have access to it.
Possibly try adb kill-server and running again from Android Studio and see if that helps.
I encountered the same problem, which I solved by checking the running devices. The connected phone had 2 accounts (might be personal & work) which was listed on the list of devices, so I had to select the second option, and it ran successfully on my phone. see the attached image.
One thing it might be:
Enable usb debugging
Settings
System
Developer options
Turn the setting on for usb debugging
If it does not appear go to settings about phone. Then click on build number like 7-10 times and it will enable you to have the developer options appear.

Xamarin Debugging on Android Device not working

I have an Xamarin project (On a Mac) that I'm working on. Up until today I was able to Launch it under debug, it would deploy the app and start it up attached so I could hit break points on the device. If I do this in an emulator, things work fine.
So when I run in Debug on Android, it deploys, I get no errors or messages that indicate an issue, but it just stops and is no longer running.
So what I've done
I've uninstalled and re-installed Visual Studio, no change
I've tried on multiple devices, with different OS versions
I've reset my project to be the same as others on the team, they have no issue
I've verified that the same project works fine on my Windows machine.
I've verified that I can run a Release version with no problem, I hit run, it deploys and launches the app just fine.
I can deply the iOS version in an emulator with no problems.
I've verified that if I set Debug Information to Full in the Release project, I have the same issue.
I've rebooted the device, the Mac, uninstalled the app on the device, it doesn't matter.
I'm at a loss, any help would be appreciated.
Well, there are a couple of things that connecting and deploying your app require, including setting the configuration and making sure you have the ADB installed correctly. You can check on Mac by following these steps to install Chrome and DevTools.
Another user suggested(in the comments under question):
"I would suggest trying to delete the Mono Shared Runtime and any Xamarin Android API-XX Support from the installed apps" on your targeted device.
These are the docs on Configuration Management in Xamarin
on Microsoft.com
I know it's very late answer but I had same problem and could solve it so may be it could be helpful for over people facing same problem.
Android csproj file must be located two levels lower than the .sln file. Android will disconnect when debugging if it is located in another location.
For example:
C:\Projects\Mobile\My.Xamarin.sln
C:\Projects\Mobile\My.Xamarin\My.Xamarin.Android\My.Xamarin.Android.csproj

APK which I developed used to work fine earlier, but suddenly stopped working with "App not installed" error

I was working on an android app to push FCM notifications.
Now this debug app was getting installed on my mobile properly, however since am using my office laptop with intel-vt (HAXM) disabled I could not use the emulator and since the USB is also disabled, I could not use the ADB to side load.
So I was left with building the APK and manually side loading it on my mobile every time I made even a small change.(Redmi Note 5 Pro).
Now this app was working fine till the last time I uninstalled it.After which I tried to install the new version which failed with error "App not installed". Then I went on to install the older version thinking I might have screwed up something in the latest version, however all the older version APKs which were working absolutely fine earlier (at least they were installing i mean) stopped getting installed with the same error.
I have already uninstalled the older version and have double checked from system and there is no earlier APK existing on my mobile.
This is driving me crazy and has put a complete halt on my work as this is the only mobile I have. And yes I have tried restarting my mobile, I have even disabled MIUI optimizations from developers menu.
PS - I am an extreme noob at Android and have recently started with Android development so please forgive me if my question sounds very silly.
Appreciate any help I can get on this.
Please follow the following steps:
Go to Settings -> Permissions -> Install via USB: Uncheck your App if
it's listed.
Go to Settings -> Additional Settings -> Privacy: Check the Unknown
Sources option.
Finally go to Settings -> Additional Settings -> Developer options:
Check the Install via USB option.

After android studio update api 24 emulator showing offline

I am using a MACbook. For one specific emulator its always showing offline. The emulator has a nexus 5 skin and is a api 24 build. When i try another emulator its fine and works. i tried re-creating the emulator. when i run adb devices it says the "unauthorized".
I tried the following:
I went into the developer settings of the emulator and allowed usb debugging if to see if that would help but it did not. this happened after i updated android studio to 2.3. i also tried to wipe user data from emulator. What is going on here ?
UPDATE: THIS IS OCCURRing for my other emualtors above api 22 also . i had to switch to genymotion for now which seems to work fine and shows as online. it has something to do with updating android studio. after i re-installed studio and did not take the 2.3 update, the problem was resolved.
Don't know the exact issue but it appears there are some bugs/issues with the latest updates.
Personally I am seeing my tests fail when run by ./gradlew commands, but not when run via Android Studio IDE.
I experienced your offline issue as well, I found I could at least rectify this by running:
adb kill-server
adb devices
More info on this in another post:
https://stackoverflow.com/a/21330228/5096103
-- UPDATE --
After investigating this one a little more, I found there to be compatibility issues between Qt version 5.7.0 which the new emulator uses, and Ubuntu 14.04 and it's version of Qt. Whatever system you will be using, you will have some version of Qt installed.
I'm guessing this may be the cause/related to the issues you are experiencing.
I was successfully able to fix my system by downgrading the SDK tools from version 25.3.1 to 25.2.3. I don't get the speed improvements of the new emulator, but at least I can run my tests reliably.
Going to try resolve the issues between Qt versions, and will update this if I can get the new emulator to work correctly again.
I had the same problem. I solved it by turning on USB debugging after unlocking developer options of the emulator by clicking 7x on the build number.

Running a Cordova project on WP8 in VS2015

I've just started a blank Cordova project on Visual Studio 2015, the intention being to use it to develop mobile apps in the future. I've been able to get it to run in the emulator on Android and even onto an iOS device (through a Mac), but I haven't been able to figure out how to run straight onto a WP8.1/Android device, or on a WP8 emulator. When I try, I get this message:
Error running one or more of the platforms: Error: cmd: Command failed with exit code 2
You may not have the required environment or OS to run this project
The Android device also says, above that:
ERROR: Failed to deploy to device, no devices found.
There's very little documentation online, and because it's all so new, Google hasn't been particularly enlightening. It's possible that I'm missing some software, but I don't know what.
For the devices, it could be that I'm supposed to select the device from a list somewhere, but I can't see anywhere that could be. For the emulator, I'm assuming I'm missing software, or a setting is wrong on my PC, but have no idea what it could be.
To fix the issue with WP8:
I had been playing around with different versions of VS... un-installing and re-installing 2013 and 2015 and eventually hit the same issue as you.
The solution here worked for me:
No Emulator lists to deploy windows phone app
I do not have an android phone to test with t the moment, so I have not seen the android device issue.

Categories

Resources