我为android创建了一个密钥,并通过phonegap build使用它来签署我的应用程序。当我尝试运行它时,应用程序崩溃了。从logcat我可以发现存在一些系统级权限问题:
07-12 17:04:34.495 2714-3126/? W/ActivityManager﹕ Permission Denial: getCurrentUser() from pid=15691, uid=10194 requires android.permission.INTERACT_ACROSS_USERS
以下是我的应用的完整logcat:
07-12 17:04:34.360 15691-15691/? I/SELinux﹕ Function: selinux_android_load_priority [0], There is no sepolicy file.
07-12 17:04:34.360 15691-15691/? I/SELinux﹕ Function: selinux_android_load_priority [1], There is no sepolicy version file.
07-12 17:04:34.360 15691-15691/? I/SELinux﹕ Function: selinux_android_load_priority , priority version is VE=SEPF_SM-T800_4.4.2_0018
07-12 17:04:34.360 15691-15691/? I/SELinux﹕ selinux_android_seapp_context_reload: seapp_contexts file is loaded from /seapp_contexts
07-12 17:04:34.360 15691-15691/? E/SELinux﹕ [DEBUG] seapp_context_lookup: seinfoCategory = default
07-12 17:04:34.365 15691-15691/? E/dalvikvm﹕ >>>>> Normal User
07-12 17:04:34.365 15691-15691/? E/dalvikvm﹕ >>>>> com.phonegap.helloworld [ userId:0 | appId:10194 ]
07-12 17:04:34.365 15691-15691/? E/SELinux﹕ [DEBUG] seapp_context_lookup: seinfoCategory = default
07-12 17:04:34.385 15691-15691/? I/dalvikvm﹕ Enabling JNI app bug workarounds for target SDK version 7...
07-12 17:04:34.495 2714-3126/? W/ActivityManager﹕ Permission Denial: getCurrentUser() from pid=15691, uid=10194 requires android.permission.INTERACT_ACROSS_USERS
07-12 17:04:34.515 15691-15691/? I/PersonaManager﹕ getPersonaService() name persona_policy
07-12 17:04:34.545 15691-15691/? I/CordovaLog﹕ Changing log level to DEBUG(3)
07-12 17:04:34.545 15691-15691/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x416eac08)
07-12 17:04:34.550 15691-15691/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.phonegap.helloworld, PID: 15691
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.phonegap.helloworld/com.phonegap.helloworld.ICT}: java.lang.NumberFormatException: Invalid long: ""
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2404)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2464)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NumberFormatException: Invalid long: ""
at java.lang.Long.invalidLong(Long.java:124)
at java.lang.Long.decode(Long.java:142)
at org.apache.cordova.CordovaPreferences.copyIntoIntentExtras(CordovaPreferences.java:142)
at org.apache.cordova.CordovaActivity.loadConfig(CordovaActivity.java:235)
at org.apache.cordova.CordovaActivity.onCreate(CordovaActivity.java:202)
at com.phonegap.helloworld.ICTSandBox.onCreate(ICTSandBox.java:30)
at android.app.Activity.performCreate(Activity.java:5539)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2368)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2464)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
07-12 17:04:36.345 15691-15691/? I/Process﹕ Sending signal. PID: 15691 SIG: 9
07-12 17:04:36.360 2714-3506/? I/ActivityManager﹕ Process com.phonegap.helloworld (pid 15691) (adj 9) has died.
这是我的config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.phonegap.helloworld"
versionCode=""
version = "1.0.0">
<name>ICT Sand Box</name>
<description>
ICT </description>
<author href="http://phonegap.com" email="support@phonegap.com">
PhoneGap Team
</author>
<preference name="phonegap-version" value="3.7.0" />
<preference name="orientation" value="default" />
<preference name="fullscreen" value="true" />
<preference name="target-device" value="universal" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="true" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="true" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="EnableViewportScale" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="true" />
<preference name="AllowInlineMediaPlayback" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="HideKeyboardFormAccessoryBar" value="true" />
<preference name="SuppressesIncrementalRendering" value="true" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-installLocation" value="auto" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="ErrorUrl" value=""/>
<preference name="BackgroundColor" value=""/>
<preference name="KeepRunning" value="true"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="LoadingDialog" value=","/>
<preference name="LoadUrlTimeoutValue" value="20000" />
<preference name="disable-cursor" value="true" />
<gap:platform name="ios" />
<gap:platform name="android" />
<gap:platform name="winphone" />
<gap:plugin name="org.apache.cordova.battery-status" />
<gap:plugin name="org.apache.cordova.camera" />
<gap:plugin name="org.apache.cordova.console" />
<gap:plugin name="org.apache.cordova.contacts" />
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="org.apache.cordova.device-orientation" />
<gap:plugin name="org.apache.cordova.device-motion" />
<gap:plugin name="org.apache.cordova.dialogs" />
<gap:plugin name="org.apache.cordova.file-transfer" />
<gap:plugin name="org.apache.cordova.geolocation" />
<gap:plugin name="org.apache.cordova.globalization" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<gap:plugin name="org.apache.cordova.media" />
<gap:plugin name="org.apache.cordova.media-capture" />
<gap:plugin name="org.apache.cordova.network-information" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:plugin name="org.apache.cordova.vibration" />
<icon src="icon.png" />
<gap:splash src="splash.png" />
<access origin="*" />
<!--gap:plugin name="com.moust.cordova.videoplayer" version="1.0.0" />
<gap:plugin name="com.sharinglabs.cordova.plugin.cache" version="1.0.0" /-->
</widget>
知道如何处理这个问题吗?
答案 0 :(得分:1)
确定。感谢所有降级问题的人,因为我相信你们都知道答案: config.xml中的以下行:
<preference name="BackgroundColor" value=""/>
不得不省略。
开发团队没有确切的解释,但这是他们发现的。 请注意,默认情况下此参数为空。
BTW即使您使用 configGap 实用程序,它也不会删除此参数。