Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
637 views
in Technique[技术] by (71.8m points)

android - SecurityException: Permission Denial error

I've just upgraded to the new version of gmail (v2.3.5) and I've got an app that queries the content provider to get details about the contacts that messages are received for......

With the latest version I'm getting the below error:

java.lang.SecurityException: Permission Denial: opening provider com.google.android.gm.provider.MailProvider from ProcessRecord{40adef58 3576:com.rageconsulting.android.lightflow/10056} (pid=3576, uid=10056) requires com.google.android.gm.permission.READ_GMAIL or com.google.android.gm.permission.WRITE_GMAIL`

For gmail in my manifest I'm declaring the following:

<!--permissions for gmail-->
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="com.google.android.providers.gmail.permission.READ_GMAIL"/>
<uses-permission android:name="com.google.android.gm.permission.READ_GMAIL"/>
<uses-permission android:name="com.google.android.gm.permission.WRITE_GMAIL"/>

So as far as I can tell I've got the permissions correct.

My gmail receiver looks like the following:

    <receiver android:name=".receiver.GmailReceiver">
        <intent-filter>
            <action android:name="android.intent.action.PROVIDER_CHANGED" android:priority="-10">
            </action>
            <data android:scheme="content" android:host="gmail-ls" android:pathPattern="/unread/.*">
            </data>
        </intent-filter>


        <intent-filter>
            <action android:name="android.intent.action.PROVIDER_CHANGED" android:priority="-10">
            </action>
            <data android:mimeType="*/*" android:scheme="content" android:host="gmail-ls" android:path="/unread/^i">
            </data>
        </intent-filter>

    </receiver>

Can anyone think of something that I may have missed out on?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Google broke it for 'security reasons'. See this support thread:

http://www.google.com/support/forum/p/gmail/thread?fid=1728955d050a12bd0004a9339272acdb&hl=en

You need to go back to the version before 2.3.5, which was 2.3.4.1


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...