我希望有人可以帮忙解决这个问题,我一直在寻找并且没有找到解释。
我使用Eclipse编写了我的应用程序并在模拟器上进行了测试,它运行正常且没有错误。当我尝试在手机上安装应用程序时,它无法抱怨需要android.permission.ACCESS_CHECKIN_PROPERTIES权限。
[2014-01-21 09:02:44 - ShoppingCalc] Android Launch!
[2014-01-21 09:02:44 - ShoppingCalc] adb is running normally.
[2014-01-21 09:02:44 - ShoppingCalc] Performing com.jwg.shoppingcalc.MainActivity activity launch
[2014-01-21 09:02:48 - ShoppingCalc] Uploading ShoppingCalc.apk onto device '42f7aa046c719f73'
[2014-01-21 09:02:48 - ShoppingCalc] Installing ShoppingCalc.apk...
[2014-01-21 09:02:50 - ShoppingCalc] Success!
[2014-01-21 09:02:50 - ShoppingCalc] Starting activity com.jwg.shoppingcalc.MainActivity on device 42f7aa046c719f73
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.jwg.shoppingcalc/.MainActivity }
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.jwg.shoppingcalc/.MainActivity } from null (pid=21219, uid=2000) requires android.permission.ACCESS_CHECKIN_PROPERTIES
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at android.os.Parcel.readException(Parcel.java:1425)
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at android.os.Parcel.readException(Parcel.java:1379)
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1930)
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at com.android.commands.am.Am.runStart(Am.java:463)
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at com.android.commands.am.Am.run(Am.java:108)
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at com.android.commands.am.Am.main(Am.java:81)
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:237)
[2014-01-21 09:02:50 - ShoppingCalc] ActivityManager: at dalvik.system.NativeStart.main(Native Method)
[2014-01-21 09:04:57 - ShoppingCalc] Dx
在模拟器上,安装应用程序看起来像这样。
[2014-01-21 09:33:48 - ShoppingCalc] Android Launch!
[2014-01-21 09:33:48 - ShoppingCalc] adb is running normally.
[2014-01-21 09:33:48 - ShoppingCalc] Performing com.jwg.shoppingcalc.MainActivity activity launch
[2014-01-21 09:33:52 - ShoppingCalc] Uploading ShoppingCalc.apk onto device 'emulator-5554'
[2014-01-21 09:33:52 - ShoppingCalc] Installing ShoppingCalc.apk...
[2014-01-21 09:34:08 - ShoppingCalc] Success!
[2014-01-21 09:34:08 - ShoppingCalc] Starting activity com.jwg.shoppingcalc.MainActivity on device emulator-5554
[2014-01-21 09:34:13 - ShoppingCalc] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.jwg.shoppingcalc/.MainActivity }
在我的研究中,我发现android.permission.ACCESS_CHECKIN_PROPERTIES权限仅适用于系统应用程序,即使包含在清单中也无法授予。
我上次在手机上工作的java代码的唯一变化是检查设备上的文件,如果它不存在,则创建该文件。
有关应用程序需要此权限的原因的任何详细信息都会很有用,我到目前为止所发现的只有最小值。
谢谢!
在2014年1月22日添加清单
<activity
android:name="com.jwg.shoppingcalc.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.jwg.shoppingcalc.EnterTaxActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.jwg.shoppingcalc.EnterQuantity"
android:label="@string/app_name" >
</activity>
答案 0 :(得分:2)
再次感谢,我能够解决问题。它在清单中,但在活动部分。
在应用程序部分添加了一行,我不确定它是如何到达的,因为我没有添加它,android:permission =“android.permission.ACCESS_CHECKIN_PROPERTIES”
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:persistent="false"
android:permission="android.permission.ACCESS_CHECKIN_PROPERTIES">
评论此行允许该应用在手机上再次安装和运行。