开发者

Added permission WAKE_LOCK, now problems on Droids

I have an existing app that was working just fine on all phones.

I added the permission WAKE_LOCK so I could control when the app goes to sleep.

It worked fine on my HTC Hero, so I published the new update. I immediately started getting emails from Droid users that the app would not launch anymore on their phones after they udpated. They get "could not launch requested activity" when the try to start the app, but it will allow them to run the app once if they ru开发者_如何学Cn it from the App Store button.

I removed the permission, and now Droid users can run the app normally.

Here is my manifest xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.krugism.EntitySensor"
     android:versionName="2.8" android:versionCode="12">
   <application android:icon="@drawable/icon"
       android:label="@string/app_name" android:debuggable="false"
       android:permission="android.permission.WAKE_LOCK">
       <activity android:name=".EntitySensor"
                 android:label="@string/app_name"
                 android:screenOrientation="portrait"
                 android:permission="android.permission.WAKE_LOCK">
           <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>
       <activity android:name=".SettingsPref" android:label="@string/app_name">
       </activity>
   </application>
       <uses-sdk android:minSdkVersion="3"     />
       <uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>

Any ideas why this would be a problem on Droid phones? I have not heard of any other phones having this problem.

Thanks, Scott


Remove all occurrences of:

android:permission="android.permission.WAKE_LOCK"

from your manifest. You do not need those. You do not want those. You do need your <uses-permission android:name="android.permission.WAKE_LOCK" /> element, though.


If permission already had on published app on play store or asks for new permission at upload time which you did not added into Manifest file then you can remove permissions using following code at Manifest file.

<uses-permission android:name="android.permission.WAKE_LOCK" tools:node="remove" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜