My phone is of course connected and when the application is starting it automatically crash displaying an error message
I deleted the whole platform folder and edited my config.xml and repeat the same process but still getting the same result.
I also noticed that the application folder is not present in my android files tough I successfully installed the program.
I used the ADT emulator with
>ionic emulate android
but still crashing.
I exported the project on my mac and try all the ios build and run command everything is working perfectly.
Finally I build and run android on the mac and emulate it , but the app is still crashing
Thanks, but I did try what you recommended am not getting any error message in the console but on the phone the alert message error is unfortunately " app name " has stop.
Is there any explication why I can not see the com.company.appname folder in my files on android.
I have to say that I recently updated my Android Development Tools
Yes I tried created another blank project , and it built and run correctly on the android.
What part of my code can I blame , when everything is working in the browser as well as on ios platform.
thanks @nicraboy, I run ‘adb logcat’ and here is the lines I am getting:
>>> loadUrl(file:///android_asset/www/index.html) D/PluginManager( 1059): init() W/System.err( 1059): java.lang.ClassNotFoundException: org.apache.cordova.file.FileUtils W/System.err( 1059): at java.lang.Class.classForName(Native Method) W/System.err( 1059): at java.lang.Class.forName(Class.java:251) W/System.err( 1059): at java.lang.Class.forName(Class.java:216) W/System.err( 1059): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:345) W/System.err( 1059): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:189) W/System.err( 1059): at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:114) W/System.err( 1059): at org.apache.cordova.PluginManager.init(PluginManager.java:92) W/System.err( 1059): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:383) W/System.err( 1059): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:368) W/System.err( 1059): at org.apache.cordova.CordovaWebView.loadUrl(CordovaWebView.java:363) W/System.err( 1059): at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:372) W/System.err( 1059): at com.ionicframework.ebolaSurveyor.EbolaSurveyor.onCreate(EbolaSurveyor.java:32) W/System.err( 1059): at android.app.Activity.performCreate(Activity.java:5231) W/System.err( 1059): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) W/System.err( 1059): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) W/System.err( 1059): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) W/System.err( 1059): at android.app.ActivityThread.access$800(ActivityThread.java:135) W/System.err( 1059): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) W/System.err( 1059): at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err( 1059): at android.os.Looper.loop(Looper.java:136) W/System.err( 1059): at android.app.ActivityThread.main(ActivityThread.java:5017) W/System.err( 1059): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err( 1059): at java.lang.reflect.Method.invoke(Method.java:515) W/System.err( 1059): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) W/System.err( 1059): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) W/System.err( 1059): at dalvik.system.NativeStart.main(Native Method) W/System.err( 1059): Caused by: java.lang.NoClassDefFoundError: org/apache/cordova/file/FileUtils W/System.err( 1059): ... 26 more W/System.err( 1059): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.cordova.file.FileUtils" on path: DexPathList[[zip file "/data/app/com.ionicframework.ebolaSurveyor-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.ionicframework.ebolaSurveyor-1, /system/lib]] W/System.err( 1059): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) W/System.err( 1059): at java.lang.ClassLoader.loadClass(ClassLoader.java:497) W/System.err( 1059): at java.lang.ClassLoader.loadClass(ClassLoader.java:457) W/System.err( 1059): ... 26 more I/System.out( 1059): Error adding plugin org.apache.cordova.file.FileUtils. D/AndroidRuntime( 1059): Shutting down VM W/dalvikvm( 1059): threadid=1: thread exiting with uncaught exception (group=0xb1ad7ba8) E/AndroidRuntime( 1059): FATAL EXCEPTION: main E/AndroidRuntime( 1059): Process: com.ionicframework.ebolaSurveyor, PID: 1059 E/AndroidRuntime( 1059): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ionicframework.ebolaSurveyor/com.ionicframework.ebolaSurveyor.EbolaSurveyor}: java.lang.NullPointerException E/AndroidRuntime( 1059): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) E/AndroidRuntime( 1059): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) E/AndroidRuntime( 1059): at android.app.ActivityThread.access$800(ActivityThread.java:135) E/AndroidRuntime( 1059): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) E/AndroidRuntime( 1059): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime( 1059): at android.os.Looper.loop(Looper.java:136) E/AndroidRuntime( 1059): at android.app.ActivityThread.main(ActivityThread.java:5017) E/AndroidRuntime( 1059): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 1059): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime( 1059): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) E/AndroidRuntime( 1059): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) E/AndroidRuntime( 1059): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 1059): Caused by: java.lang.NullPointerException E/AndroidRuntime( 1059): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:191) E/AndroidRuntime( 1059): at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:114) E/AndroidRuntime( 1059): at org.apache.cordova.PluginManager.init(PluginManager.java:92) E/AndroidRuntime( 1059): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:383) E/AndroidRuntime( 1059): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:368) E/AndroidRuntime( 1059): at org.apache.cordova.CordovaWebView.loadUrl(CordovaWebView.java:363) E/AndroidRuntime( 1059): at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:372) E/AndroidRuntime( 1059): at com.ionicframework.ebolaSurveyor.EbolaSurveyor.onCreate(EbolaSurveyor.java:32) E/AndroidRuntime( 1059): at android.app.Activity.performCreate(Activity.java:5231) E/AndroidRuntime( 1059): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) E/AndroidRuntime( 1059): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) E/AndroidRuntime( 1059): ... 11 more W/ActivityManager( 394): Force finishing activity com.ionicframework.ebolaSurveyor/.EbolaSurveyor
Thanks
The plugin got mangled in your Android build. Maybe try removing the plugin and then re-adding if this is the case.
The plugin needs to be used only after the onDeviceReady has fired
The plugin itself has a bug and you need to contact the developer
Your stack-trace doesn’t show what line the code is failing at, so I can’t help you determine if it is bad code. See if you can get me more information relating to the bullet items I listed.
Thanks @nicraboy , you were right I used ngCordova and I think they made some updates on the file and ionic keyboard plugins.
I didn’t have the correct ones on my cordova plugin ls or mine got corrupted, anyway I can run or emulate my project on android after removing and installing the plugins.
thanks also for this useful debug command.
ADB logcat
I didn’t know such useful tools was out there.
Thanks
usually this kind of bug are related to the Cordova plugins API, in your case the FileTranfer plugin might be causing the bugs, try to reinstall all the plugin using cordova command.
might have lots of reason for this but how I fixed this that -->>
I was using contact plugin and in my phone have some blank contact with No Names are present in my phone which was sync from one of mail Id.
so I have deleted all the blank contact and remove the mail account due to this Problem is solved .
so my point is this your phone might be responsible for crashing the app. try with different model of android/iPhone.
Hi nicraboy,
I am having trouble to run ionic1 app on android. My app is working fine with IOS and testflight.
App loads landing page and close the app on real device. Ionic view on android is also not working.
Please assist me, or let me know if you need more information.