How to diagnose meteor android app crashing on opening app - android

Meteor 1.8.2. I try to open the app on the simulator or real device and it crashes before showing any splash screen. It shows the error “The app has stopped”
This happens both locally (with the meteor run android command) and with the staging version (with meteor build).
If I use another computer to build the app from the same source, it works (both macbooks 2015~2016)
I tried
older versions of the same app
deleting cordova-plugins
removing and adding platform
meteor reset
removing cordova cache
downgrading Android Studio and Platform Tools
deleting the entire project and re-cloning from github
running the emulator directly with verbose log ($ emulator #Nexus_4_API_27 -verbose; I get logs as the emulator starts up but nothing when I open the app and it crashes)
reinstalling meteor
copying the entire Android SDK folder from the other computer
Nothing worked.
If anyone has any clues how I could diagnose this I would be grateful.

Eventually, some combination of the following seems to have solved it
changing back to the previous Android SDK folder
updating to the latest patch of Platform Tools and SDK Tools
updating Meteor to the latest version 1.10.2 (which includes a cordova update compared to Meteor 1.8.2)

Related

Ionic 4 Running on Device: "Could not find an installed version of Gradle either on Android Studio or in System" Although I have it on my system

I'm trying to run a blank app of ionic 4 on my android 9 device. Already followed each step on the website and running it on browser is okay.
When I run it on my device here is what i get:
Error when running
It says I dont have gradle and android studio but here is my environment:
android sdk list,my /etc/environment,and my npm, ionic, gradle and java versions
Am I missing something guys?
This error occurs when gradle is not properly installed. I have experienced this before. try installing gradle on your system.
For some reason the ionic project does not locate the gradle, to verify that this is the case, try opening the project on android studio and you will get the warning that no gradle wrapper was found.
IDK if some of you people have the same problem, but it's because of the Gradle. Installed it the way the website said, tried both automatically with SDK manager and also the manual downloads. Still no. So I installed it using:
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle
Then find location where it was installed then add to path. Now I can install the app on my device
Your question is not clear, are you facing error on local emulator or real mobile device?
it seems you are trying to run on local android emulator, can you please mention that where you are facing error?
Also, please do debug or production build with the help of ionic cordova build android command and try to run on your android device, generally android studio will pops up of gradle build update, which will help to generate faster sequential android build, and which needs gradle for it.

Angular/Ionic App Live Reload Not Updating App When Running in Android Studio Emulator

I can manually run in my Mac terminal "ionic capacitor run android" and then press the play button manually again in Android Studio to view the application with its updated code changes.
However, if I try to use "ionic capacitor run android -l" in my Mac terminal my updated application with the changed code will not automatically load into the emulator to view the application with its updated code changes.
Have you updated everything to the latest CLI version? (v5)
In a recent update they changed the systems which power this over to the native-run package.
This has resolved issues connectivity issues with me in a similar scenario.
There are some update steps you need to follow to update your tooling and potentially your project as well which can be found here:
https://github.com/ionic-team/ionic-cli/blob/develop/packages/ionic/CHANGELOG.md#lollipop-upgrading-from-cli-4

Running react-native run-android builds successfully but stays stuck at Starting the app

Running my React Native application via the Bash terminal onto the Android emulator builds successfully, but remains stuck at:
info Starting the app (adb shell am start -n com.myapp/com.myapp.MainActivity...
The Metro Bundler is running, with nothing else on the same port and no errors. The app just never actually loads up into the emulator after a successful build (Pixel 2 XL API 27).
Running directly from Android Studio pushes the app into the emulator no problem and it runs just fine (pressing the green arrow button or hitting Shift+F10). This is happening on a new Windows 10 laptop. Running this same project on another Windows 10 desktop and macOS macbook 2018 this issue does not occur.
I've also let it sit at 'Starting the app' for almost half an hour, and nothing occurs. To note, on the other machines it loads instantly onto the emulator.
The other machine's differences lie in the version of Android Studio installed.
On working Windows 10 desktop:
Android Studio version 3.1.2
JRE version 1.8.0_152
java version "1.8.0_211"
On working macOS Mojave 10. macbook 13" 2018 macbook:
Android Studio version 3.3.2
JRE version 1.8.0_152
java version "1.8.0_181"
On this Windows 10 laptop where it's NOT working:
Android Studio 3.4.1
JRE version 1.8.0_152
java version "1.8.0_211"
This is happening with React Native 0.59.8 which is the latest stable version at the time of this question being posted, with React version 16.8.3. The following command is being run through the bash terminal.
react-native run-android
The expected output of running the above should be that it loads up into the already-on emulator.
I'm suspecting the difference being in how brand new Android Studio is on this laptop, but downgrading to an older version is not an option. Any suggestions or guidance is greatly appreciated.
Managed to solve it, had to run through a few steps to get it working. Here's what I did.
With the project open in Visual Studio Code, cd into the android folder and run:
./gradlew clean
That stops it from getting stuck at 'Starting app' but I then ran into:
'adb' is not recognized as an internal or external command,
operable program or batch file.
To fix that, open Environment Variables (hit Windows key, search for 'environment' and click on Edit the system environment variables).
Click on the button that says 'Environment Variables...'.
Under System variables, click 'New...'.
Variable name: ANDROID_HOME
Variable value: C:/Users/USER/AppData/Local/Android/Sdk
Where USER is whatever your Windows username is.
That fixed the 'adb' error, but I then ran into the metro server error:
Unable to load script. Make sure you're either running a Metro server ...
Despite closing all terminals, visual studio code, and any node processes this issue persisted. Only after restarting Windows, did this issue go away and running the following worked:
react-native run-android
That's it. Hopefully it helps another. Basically, needed to clean gradle, add Android studio sdk to environment variables and do a restart. Now it all works.

Cannot Emulate Ionic v1 app to Android Emulator

I am developing an ionic app. And I want to emulate it on real Android device. I already downloaded the Android Studio. I plugged my Android device and when I tried to run this command ionic cordova run android There's a lot of errors.
Note: I am on Windows 8.1 32bit. JDK 32 bit.
This is for an academic thesis.
This is the error:
Have you enabled usb debugging on your device? You'll have to enable developer mode on your Android. Google can tell you how, but you just go to settings/about/build number, tap 7 or 8 times... Then, you should be able to use ionic run android --device. That should build out to emulate so long as you've installed the Android sdk.
It can be solved by removing platforms, then add again.
ionic cordova platform rm android
ionic cordova platform add android
if above solution does not work please run following command,
ionic cordova run android --livereload
If still problem persist,run same command with --verbose options,
ionic cordova run android --verbose
Alternatively , and way faster , you can build your app then drag/drop it inside the emulator (running aside)..it will install quicker and run sleeker.
And you'll have peace of mind , I know this is not what you're looking for ,but still a nice hack if you're time-bound.
I already solved my problem! As we can see in the error that I posted, it is the gradle file! It is corrupted download. What I did is delete the .gradle folder and run ionic cordova run adnroid. In that way, it will automatically download the gradle file! Thanks for the replies by the way!

Using genymotion plugin for gradle in eclipse

I was trying to load an android studio project on eclipse. I found out that i would have to install the gradle plugin. I figured it all out and i was able to successfully load the project into eclipse.
I always use Genymotion as an emulator with eclipse. As now i've loaded a gradle project into my eclipse i'm seeing the following options to run the app.
I am unable to find a plugin for this or anything to run this app on genymotion
http://i.stack.imgur.com/0MDnw.png
Please help
The Genymotion Gradle plugin is available.
Here is the documentation to use it on your project.
This plugin will allows you to create, launch and configure Genymotion devices directly from your build.gradle file.
NB: You will need Genymotion 2.5.0 or higher.
Important, the Gradle plugin for Genymotion is not mandatory to simply install/test/debug your app from your IDE.
Since your project is an Android Gradle project, you can build your app running the command gradlew assembleDebug task (or click on "Run" button on your IDE). This will automatically find all Android devices connected to your computer through adb. It can be emulators like Genymotion or real devices.
So, you only have to manually launch the Genymotion device(s) you want to work with before compiling your app and it will automatically be installed on the connected Android devices.

Categories

Resources