Android Emulator is running but not loading my app in Titanium - android

I can run the app in the "mobile app preview in browser", and I can boot up the Android Emulator successfully. But the emulator just showed me the home screen all the time without loading my app. I've looked through all the similar questions online but couldn't find a solution.
Here is the console...hope someone can help me out. Thanks!
*Titanium Command-Line Interface, CLI version 3.1.0, Titanium SDK version 3.1.0.GA
Copyright (c) 2012-2013, Appcelerator, Inc. All Rights Reserved.
[INFO] : Running emulator process: python "C:\Users\Ni\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.GA\android\builder.py" "emulator" "myFirstApp" "C:\Users\Ni\Android-sdk\adt-bundle-windows-x86\sdk" "C:\Users\Ni\Documents\Titanium_Studio_Workspace\myFirstApp" "com.yn.myFirstApp" "4" "HVGA" "armeabi"
[INFO] : Running build process: python "C:\Users\Ni\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.GA\android\builder.py" "simulator" "myFirstApp" "C:\Users\Ni\Android-sdk\adt-bundle-windows-x86\sdk" "C:\Users\Ni\Documents\Titanium_Studio_Workspace\myFirstApp" "com.yn.myFirstApp" "4" "HVGA"
[INFO] logfile = C:\Users\Ni\Documents\Titanium_Studio_Workspace\myFirstApp\build.log
[INFO] Building myFirstApp for Android ... one moment
[INFO] Titanium SDK version: 3.1.0 (04/15/13 18:45 57634ef)
[INFO] : Emulator process exited successfully
[INFO] : Project built successfully in 3s 24ms
[INFO] : Emulator not running, exiting...*

Don't know if you have solved this, but for the reference of others, you shouldn't run the emulator yourself, allow Titanium Studio to launch the emulator by simply running your application with the emulator option (like Martin says)
In my own experience, i'm able to run my app in the emulator, but for all subsequent runs, i need to close the emulator and run the app again since Studio fails to detect the emulator and gives me an error similar to yours.

I forgot to add an answer for this question...
I could successfully run the Titanium only when I choose "run as administrator".

When this happens, you can install the app manually.
You will find your app's executable in the following directory under your app directory: build/android/bin/YOURAPPNAME.apk. On the Mac, you need to open a terminal window, cd to that directory, and type "chmod 777 YOURAPPNAME.apk". Then cd to the platform-tools directory under your android sdk installation directory, and run the following commands:
./adb kill-server
./adb start-server
./adb install <full path name to YOURAPPNAME.apk>
You will see your app appear on the home screen of the emulator.
I made a shell script to do this.

Related

Can't able to run react native application on android device

Im Using MacBook Pro.. Im New To React Native.. After Creating An Project Im Running On iOS Device It's Running.. At The Same Time While I'm Running On Android Device Means Im Getting This Error.. Any One Please Help Me To Resolve This Error.. Im Using Visual Studio Code IDE For React Native Application
Thanks In Advance..
Error Details :
[Info] local.properties file doesn't exist. Using Android SDK location from PATH.
[Info] Starting React Native Packager.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 8 workers...
/bin/sh: adb: command not found
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
* Where:
Settings file '/Users/manikandan/AwesomeProject/android/settings.gradle'
* What went wrong:
Could not compile settings file '/Users/manikandan/AwesomeProject/android/settings.gradle'.
startup failed:
General error during semantic analysis: Unsupported class file major version 57
So you have two errors to fix here as your error log
local.properties file doesn't exist.
Failed to launch the emulator
local.properties file issue fixing
Open your react native project android folder using Android Studio.
Wait for gradle sync and clean the project and rebuild it using Android Studio
After that make sure you have local.properties file is been created inside android folder
If not try these steps to make local.properties file manually
Right click top level of project and Create new file 'local.properties' then add: sdk.dir=/Users/<YourUsername>/Library/Android/sdk
Clean and build
Before running your react native project on android make sure you have turn on the Android Emulator by AVD Manager in Android Studio
If you have not create any emulators then try this link - I have posted full answer on how to make Android Emulator -
React native failed to launch emulator
EDIT :
For adb error you need to install adb drivers on you Mac
Follow these steps
First install Homebrew using this command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
or this command
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After that install adb using homebrew
brew cask install android-platform-tools
Try to re run

React-native does not find Genymotion

I installed android studio, I configured the environment variables and everything, I installed genymotion and created a device, but running the react-native run-android in the project folder occurs the following error:
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.
please help me in this problem. React-native does not find Genymotion disositivo, in this link has more details: https://pt.stackoverflow.com/questions/382115/react-native-n%C3%A3o-reconhece-genymotion
It tries to connect the emulator to the ADB, by the IP of the device. To check the IP of the device, simply click on an emulator window, the IP address is in the title of the window.
No terminal will run the command:
$ adb connect ip_of_your_emulator:5555
Soon after, run:
$ adb devices
If the name of your file appears in the list, your emulator has been connected successfully!
With the emulator open, simply run the native run-android in the folder of your project.
I've had the same problem earlier this month. As far as I can tell the newer versions of Genymotion don't register on adb devices, a user in the Expo forums speculates it's because they have a paywall now.
I recommend switching to Android Studio, that's what I did to solve my problem.
I ran react-native with the --verbose flag, and got the following error:
...
error Failed to install the app. Make sure you have the Android development
environment set up: https://reactnative.dev/docs/environment-setup.
Error: spawn ./gradlew EACCES
...
So, I gave permissions to the android/gradlew folder as follows:
chmod 755 android/gradlew
But then, I got an error regarding Google Play Licenses:
error Failed to install the app. Please accept all necessary Android SDK
licenses using Android SDK Manager: "$ANDROID_HOME/tools/bin/sdkmanager --licenses".
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
So yeah, pretty the solution was:
Downloading Android Studio with its own SDK
Change the env variabe ANDROID_HOME to the one installed with Android Studio
Installing Google Play Licensing Library (In Android Studio, go to Settings>SDK Manager>SDK Tools, select Google Play License Library and then install)

Android Emulator not running for Cordova App - adb -s emulator-5584 shell cat /proc/cpuinfo

I'm trying to make my environment work with Cordova and Android emulator with no success. I have installed the Android Studio and I can successfully start the Android Emulator.
I have created a cordova application with the command below:
cordova create myApp
I added support for the Android platform:
cordova plataform add android
I had the following output:
Using cordova-fetch for cordova-android#~6.2.2
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android#6.2.3
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
--save flag or autosave detected
Saving android#~6.2.3 into config.xml file ...
Then I try to run the application:
cordova run android
The emulator starts, after a while, that I have the error below in the command prompt:
No target specified and no devices found, deploying to emulator
No emulator specified, defaulting to Nexus_5X_API_24
Waiting for emulator to start...
Error: Failed to execute shell command "getprop,dev.bootcomplete"" on device:
Error: C:\Users\username\AppData\Local\Android\sdk\platform-tools\adb.exe: Command failed with exit code 3221226356
Does anyone knows how to fix this error?
Some others environment info:
C:\>node -v
v7.4.0
C:\>cordova -v
7.0.1
C:\>java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Edit 1
I have done those steps:
Uninstalled "Android SDK Tools"
Uninstalled "Android Studio"
Deleted files from "C:\Users\USER\AppData\Local\Android\sdk" and "C:\Program Files\Android\Android Studio" files (Because some maybe in use during the uninstallation)
Installed Android Studio
Updated Android Studio
When I execute the command below, I have more information about the error:
cordova run android --verbose
With this output:
Command finished with error code 3221226356:
C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe
-s,emulator-5584,shell,cat,/proc/cpuinfo Error: Failed to execute shell command "cat,/proc/cpuinfo"" on device: Error:
C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe:Command
failed with exit code 3221226356
When I execute the command below, the adb shows the emulator cpu info, after that, the process stops and the windows ask to break or debug
adb -s emulator-5584 shell cat /proc/cpuinfo
Downgrade your SDK platform-tools to rev25.0.1.
If you dev in windows, you can download it in https://dl-ssl.google.com/android/repository/platform-tools_r25.0.1-windows.zip
delete or rename your old platform-tools folder, and extract the downloaded file to it.
Works for me!
I encountered the same issue with an emulator of Nexus5 & Oreo/Nougat.
I changed my emulator to Galaxy Nexus & Lollipop and it worked fine without any modification in the Cordova directories.
It does not seem to be the right solution, but some lower combinations might be available for avoiding this issue.
The command line is:
$ cordova emulate android
The following is the success log:
No emulator specified, defaulting to Galaxy_Nexus_API_22
Waiting for emulator to start...
emulator: Requested console port 5584: Inferring adb port 5585.
emulator: WARNING: encryption is off
path /home/ximia/.android/avd/Galaxy_Nexus_API_22.avd/system.img.qcow2
Waiting for emulator to boot (this may take a while)...BOOT COMPLETE
Edit your virtual device (ADV) and go into advanced settings and uncheck Multi-Core CPU.
Work fine to me.

Titanium Build Error Invalid Device

I've recently updated my Android SDK to the latest available and I'm getting the following error when I try to build from the command line and deploy to my Samsung Galaxy S3:
$ titanium build -p android -T device -C --device-id 6f01b9ae
Titanium Command-Line Interface, CLI version 3.4.0, Titanium SDK version 3.4.0.GA
Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
[ERROR] : Invalid "--device-id" value "6f01b9ae"
For help, run: titanium help build
Does anybody have anything I can try to get past this? I'm pretty stuck and would really appreciate some help.
Thanks!
Because the Titanium tooling uses android's adb to push to your device, first run
adb devices
Verify that the device is seen by adb and that the id you are using matches.
Second, -C and --device-id are the same flags and do not need to be repeated. These are the same:
$ titanium build -p android -T device -C 6f01b9ae
$ titanium build -p android -T device --device-id 6f01b9ae

Qt 5.2 and Android Error

So after a few hours of struggling to set up my Qt so I can start with my first Android app I am still without luck.
I’ve gotten a VERY simple program (just to get all the settings right) to build properly but when I click the play button to run it, there is an error I cannot seem to solve. Here is the complete output when I press play:
22:16:45: Running steps for project Androidtest...
22:16:45: Configuration unchanged, skipping qmake step.
22:16:45: Starting: "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
22:16:48: The process "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
22:16:48: Starting: "mingw32-make" INSTALL_ROOT="D:\\RundownRiot\\Androidtest\\build- Androidtest-Android_for_arm_GCC_4_6_Qt_5_2_0-Debug\\android-build" install
qtcreator_ctrlc_stub: Command line failed: mingw32-make INSTALL_ROOT="D:\\RundownRiot\\Androidtest\\build-Androidtest-Android_for_arm_GCC_4_6_Qt_5_2_0-Debug\\android-build" install
22:16:48: The process "mingw32-make" exited with code -1.
Error while building/deploying project Androidtest (kit: Android for arm (GCC 4.6, Qt 5.2.0))
When executing step 'Copy application data'
22:16:48: Elapsed time: 00:03.
The error is in line 6.
I read that sh.exe might be in the path variable but I don’t think its there, here is the value for path:
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files\CineForm\Tools;C:\Program Files\QuickTime\QTSystem\;
C:\Program Files\Windows Live\Shared; C:\Program Files\Java\jdk1.7.0_51\bin;
C:\Android\AndroidSDK\sdk\tools;
C:\Android\AndroidSDK\sdk\platform-tools;C:\Program Files\Java\jdk1.7.0_51\bin;
C:\Qt\Qt5.1.1\5.1.1\mingw48_32\bin;
I am using win7 32bit, Qt5.2 and Qt Creator 3.0.1.
I found that I had more than 1 version of Qt installed. So I uninstalled Qt completely and only installed the latest version. That solved all my problems.

Categories

Resources