My Ionic app works fine on browser but does not open in my phone - ionic-framework

my ionic project works fine with ionic serve --lab ,but while copied the.apk file in build folder to my phone and install the app but blank screen appears ,
Please can anyone suggest what might be my problem
my app is using google maps,key is provieded for both app and browser in index.html

Have you tried running it in the emulator ? Since its much easier to see the error logs . Try ionic emulate android -l or ios -l (whichever OS you are building for) and then once the execution starts run the command consolelogs it will log all the activity and you will have a better understanding about why its not working.

+1 for using Chrome Remote Debugging feature. It give you the same output as you would receive from running you app in the browser.
Additionally, I have found that sometimes if your app is already compiled, the ionic CLI doesnt always copy your current files into the APK, and uses the older cached files instead. If you are banging your head against the wall, run the following commands to make sure you have your latest code in your APK.
ionic platform remove android
ionic platform add android
ionic run android

I suggest you use the Chrome Remote Debugging feature. I encountered the same, and looked for answers to my symptom for hours. Once I connected to the chrome remote debugger, I got the console.log back, and noticed there was a problem in my routing setup.

It was a problem with ionic CLI. I've updated it to the latest and reinstalled all dependencies.

Related

Can't navigate to url in Google Chrome Android Emulator, just says Data;,

I am using eclipse, Appium 1.6.4 and Android Studion with Android 7.0 also tried with 6.0.
I run my automated test and it executes, it connects to the device, it opens the chrome browser but then doesnt navigate to the google url using the driver.get(...) method it just says data;, . I dont get any errors until it eventually times out and tries running it again.
Any help would be appreciated as ive tried a few things and got nothing.
Thank you.

DeviceInfo native module is not installed correctly

So I tried implementing Facebook Login and followed all the steps accordingly. After having errors with FBSDKcorekit/FBSDKcorekit.h' file not found, I decided to pivot over to working on other components.
Lo' and behold, I have this error giving me trouble now. I followed along with this video: https://www.youtube.com/watch?v=rAXVKapP5cM&t=458s where I used the react-native install react-native-fbsdk and react-native link react-native-fbsdk commands in my terminal.
If it helps, I'm getting the following compile error in my terminal:
The following build commands failed:
CompileC /Users/someUser/desiredProject/ios/build/Build/Intermediates/RCTFBSDK.build/Debug-iphonesimulator/RCTFBSDK.build/Objects-normal/x86_64/RCTFBSDKGraphRequestManager.o RCTFBSDK/core/RCTFBSDKGraphRequestManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
I'm not sure if it was the tinkering around with the react-native-fbsdk or making links to it that caused this error. Note my project was working before I was trying to implement Facebook Login and using the link command.
What's going on here?
Thanks in advance for your time and patience.
edit: Also I did not implement any of the Facebook login code yet since I couldn't get a successful build on Xcode.
#kdizzle Make sure you have the right packager running in the terminal, sometimes you may have a packager associated with another react native project running, this happens because when you stop running an xcode RN project, it doesn't stop the packager in the terminal, and when you start/open another RN project in xcode, it simply checks if a packager is running, doesn't check if it's associated with the current project. So make sure you stop all of the packager instances in the terminal and then open the RN project again.
This may happen when upgrading a project to a newer version of react-native. To fix it,
Stop your packager.
Quit your iOS/android simulator.
Reinstall your modules: rm -rf node_modules && npm install
Restart your packager and simulator, e.g. react-native run-ios
I had this issue and it happened when I changed Hardware within the simulator. To fix it I had to kill the packager and run 'react-native run-ios' again. It didn't happen all the time but when it did this fixed it for me!
Another use is in a Brownfield App. Check your iOS and/or Android react-native versions. If they don't match exactly you will see this error screen too.
For example: I had a react native instance running 0.45.1 while Android had 0.45.0 installed. The solution for me was to make sure everything was running the same version.
None of the above answers have worked for me, so I researched the 'react-native' options a little and ended up:
Deleting the iOS and android folders from the app directory altogether
Running 'react-native eject'
Re-running 'react-native run-ios'
After that the iPhone emulator seemed to have no problem with the app.
This problem would appear when React Native libraries in ios project can not found.
I happend to meet this problem when i update my react-native version from 0.42 to 0.44, and cause that a file named RCTConvert+Map disappear in 0.44, so i update my pod.
command: pod update

ionic 2: keeps stopping on android emulator

This is my first time writing an ionic 2 app. I have cloned from github a tutorial app and successfully built it on my local pc.
$ npm install
$ ionic platform add android
$ ionic build android
This command works $ ionic serve --livereload (I can run my app in the browser, set breakpoint and debug in visual studio code. Everything works perfectly)
But when I attempt to deploy the app on my android emulator
(target:Android 7.0, cpu/abi: Intel Atom (x86_64), Ram 2048, VN Heap:64), this app craches.
This is the command to deploy app to emulator:
$ ionic run android
And this is the crach:
I have looked at many threads over the internet. Some suggest to reinstall every thing. (But ionic server works perfectly...). Here are my system specifications:
npm:
ionic 2:
Please any help would be greatly appreciated
I also had the same problem with ionic when running on emulator.
I solved it by making sure that the value for FadeSplashScreenDuration and SplashScreenDelay are set as Integers, instead of doubles in the config.xml file under your ionic project folder.
It might be not the solution you were looking for but lately I had the same problem and couldn't found the solution.
My target on emulator had android 7.0 version (API 24).
It started to working when i created new device with android 6 (API 24).

Error on ionic build command

i am facing this error when i want to run ionic build android command.
i tried everything and obviously i have no idea what to do here .
i have SDK and JDK , Gradle and other things .
if i run the ionic serve command it works with no problem and the app shown in the browser but i can't build the app with build command .
i installed the cordova and ionic using this tutorial http://learn.ionicframework.com/videos/windows-android/ and i think i dont miss anything around here .
when i run android command , it shown up the android sdk manager with the API installed , when i run gradle it works . but this one does not work
here is the picture of the error :
This happens to me with ios builds and re-installing the platform will always worked for me. try that
ionic platform remove android
ionic platform add android
read here on almost the same thing (but with ios)
HTH

Cordova loading app into android emulator

I am totally new to Cordova, but now I have installed Cordova with NPM and installed Android SDK and set up an AVD which seems to work perfectly, until I want to emulate my project. Where the actual app for some reason is not loaded into the emulator.
The following action is done:
marvin:HelloWorld$ cordova -d emulate android
cordova library for "android" already exists. No need to download. Continuing.
Wrote out Android application name to "HelloWorld"
Wrote out Android package name to "com.example.hello"
Calling plugman.prepare for platform "android"
Preparing android project...
Processing configuration changes for plugins.
Iterating over installed plugins: []
Writing out cordova_plugins.js...
Running on emulator for platform "android" via command ""/home/marvin/Development/projects/HelloWorld/platforms/android/cordova/run" --emulator" (output to follow)...
Then it start Android emulator up, but the app is not there. Does anybody have a suggestion to fix this issue, so I am capable of actually testing in my emulator?
Thank you in advance.
I just had the same problem, and I was missing PATH to platform-tools in android sdk folder, after I added it everything was in place.
I had the same problem as well; I could run the cordova emulate android command just fine, and the emulator would eventually start up and function, however, the test app was never installed on the device. I was not getting any errors from the Cordova CLI or the console or anything.
I found that there is a bug report about this issue here: https://issues.apache.org/jira/browse/CB-4285
Two solutions have been found for this issue:
1. Make sure you are using an Oracle JDK and not an IBM JDK, and
2. Make sure the AVD that emulate starts up has a min-target-sdk set to API 10 (Android 2.3.3) or higher. (This was my problem.)
Sometimes it works deleting the previously installed version of the app in the emulator. For this you could also launch it with the option "Wipe user data" checked.
Just for the record, none of the other solutions worked for me.
I had the same issue. Following solved it for me.
Make sure that API level of your AVD is greater than minSdkVersion specified in config.xml specified in your cordova app.
If anyone still having this issue:
I had a same problem with device being offline.
if ddms is running it looks after connected devices.
adb kill server
and than run ddms
Also make sure your app id doesn't begin with a number or any other character like "_". For example, if your app id is com.4company.MyApp or com._company.MyApp it just won't load on the emulator. The first one is because Java doesn't allow names beginning with a number, and the second one I guess it's a Cordova thing.
You should also use adb logcat to show the emulator errors on the command line.
For me, the app was not starting up because I had a second emulator running in the background. Uninstalling bluestacks (android emulator for windows) fixed the issue in my case. Running "adb logcat" should tell you if you have multiple emulators running.
I just had the same problem, and It was my emulator device that was with the API 15. Just updated to API 17 and the problem solved.