在Android上使用离子崩溃而不是ios构建的混合应用程序
I'm building an app using the Ionic framework and AngularJS. When I run ionic run android the app installs and then crashes on my device. I ran logcat to watch the crash happen and it was throwing java.lang.NumberFormatException: Invalid long: ""
我正在使用Ionic框架和AngularJS构建应用程序。当我运行离子运行android时,应用程序安装然后在我的设备上崩溃。我运行logcat来观察崩溃发生并抛出java.lang.NumberFormatException:无效长:“”
Interestingly the app runs on iOS perfectly fine, it only crashes on android. Anywho know what I should be looking for to fix this? I'm having a hard time trying to find the issue as the code is in javascript and html so I can't find where the invalid long is.
有趣的是,该应用程序在iOS上完美运行,它只在Android上崩溃。任何谁知道我应该寻找什么来解决这个问题?我很难找到问题,因为代码是在javascript和html中,所以我无法找到无效long的位置。
full log cat of the exception
异常的完整日志猫
E/AndroidRuntime( 3057): FATAL EXCEPTION: main
E/AndroidRuntime( 3057): Process: com.gravityfusion.findmydriver, PID: 3057
E/AndroidRuntime( 3057): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gravityfusion.findmydriver/com.gravityfusion.findmydriver.CordovaApp}: java.lang.NumberFormatException: Invalid long: ""
E/AndroidRuntime( 3057): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
E/AndroidRuntime( 3057): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
E/AndroidRuntime( 3057): at android.app.ActivityThread.access$800(ActivityThread.java:144)
E/AndroidRuntime( 3057): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
E/AndroidRuntime( 3057): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3057): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 3057): at android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime( 3057): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3057): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 3057): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime( 3057): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
E/AndroidRuntime( 3057): Caused by: java.lang.NumberFormatException: Invalid long: ""
E/AndroidRuntime( 3057): at java.lang.Long.invalidLong(Long.java:124)
E/AndroidRuntime( 3057): at java.lang.Long.decode(Long.java:142)
E/AndroidRuntime( 3057): at org.apache.cordova.CordovaPreferences.copyIntoIntentExtras(CordovaPreferences.java:139)
E/AndroidRuntime( 3057): at org.apache.cordova.CordovaActivity.loadConfig(CordovaActivity.java:240)
E/AndroidRuntime( 3057): at org.apache.cordova.CordovaActivity.onCreate(CordovaActivity.java:207)
E/AndroidRuntime( 3057): at com.gravityfusion.findmydriver.CordovaApp.onCreate(CordovaApp.java:30)
E/AndroidRuntime( 3057): at android.app.Activity.performCreate(Activity.java:5933)
E/AndroidRuntime( 3057): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime( 3057): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
E/AndroidRuntime( 3057): ... 10 more
~edit I can build the app with no errors or warnings using ionic build android
. I can install the app on my device. When I go to run it, it instantly crashes.
〜编辑我可以使用ionic build android构建没有错误或警告的应用程序。我可以在我的设备上安装该应用程序。当我去运行它时,它会立即崩溃。
1 个解决方案
#1
2
Because of this line in the error
因为这行错误
at org.apache.cordova.CordovaPreferences.copyIntoIntentExtras(CordovaPreferences.java:139)
I had a look in the config.xml file where the preferences are entered. I found several errors in the preferences that iOS defaults but android doesn't like <preference name="BackgroundColor" value="0xffffffff"/>
which was <preference name="BackgroundColor" value=""/>
我查看了输入首选项的config.xml文件。我在iOS默认的首选项中发现了几个错误但是android不喜欢
更多相关文章
- JS之arguments 引发的一个错误
- 没有'Access-Control-Allow-Origin'反应表达docker应用程序
- PHP发布请求未识别的索引错误
- 如何测试从实时网站提取数据的AJAX应用程序?
- AngularJS错误:模块ngAnimate不可用
- 如何在单击按钮时将桌面应用程序导航到系统中设置的默认邮件提供
- Angular 2快速入门 - 我的应用程序组件未加载
- 键盘出现时,UIWebView滚动。导致点击偏移错误?
- 如何使用try,catch在错误处理中打印消息