I've been following Android's Creating a Sync Adapter (BasicSyncAdapter) to start out my own sync service logic.
The problem: Upon invoking AccountManager.addAccountExplicitly(), a SecurityException is raised, claiming a mismatch between caller and authenticator UID's:
java.lang.SecurityException: caller uid 10048 is different than the authenticator's uid
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.accounts.IAccountManager$Stub$Proxy.addAccount(IAccountManager.java:580)
at android.accounts.AccountManager.addAccountExplicitly(AccountManager.java:565)
App / Library Structure: My app is divided into two modules (gradle / android studio projects):
Android Library (com.example.mylib), which contains the sources and xml's necessary for defining a sync service, adapter, authenticator, etc.
Android Application: to test/demo the library functionality (com.example.mylib.app).
This seems relevant, since the two apps are of different packages. For this reason I've set up the sharedUserId property in the two project manifests (and according to the packages.xml snippets below, it seems to be set up correctly).
All required permissions seem to be set up correctly (namely: READ_SYNC_SETTINGS, WRITE_SYNC_SETTINGS, AUTHENTICATE_ACCOUNTS, USE_CREDENTIALS, GET_ACCOUNTS and MANAGE_ACCOUNTS).
I've also set explicit values for manifest properties (and not going through #string/... expansions) - see below.
Also tried clean builds, clean installs, restarts, etc.
Tech details / dumps follow.
Environment / Setup
Using Android Studio (version 1.3)
targetSdkVersion is 22 (for both projects)
Running on an emulator (genymotion)
System logcat dumps
Following the advice mentioned in this question, I've checked Android System Logcat's seem to be alright as well (until the exception is encountered):
Before (clean installation):
08-10 10:43:39.375 9015-9031/system_process D/PackageManager﹕ New package installed in /data/app/example.mylib.app-1.apk
08-10 10:43:39.387 9015-9027/system_process D/PackageManager﹕ generateServicesMap(android.accounts.AccountAuthenticator): 3 services unchanged
08-10 10:43:39.387 9015-9027/system_process D/PackageManager﹕ generateServicesMap(android.content.SyncAdapter): 6 services:
New service added: ServiceInfo: SyncAdapterType {name=com.example.mylib.provider, type=com.example.mylib.provider.ACCOUNT, userVisible=false, supportsUploading=false, isAlwaysSyncable=true, allowParallelSyncs=false, settingsActivity=null}, ComponentInfo{com.example.mylib.app/com.example.mylib.service.SyncService}, uid 10048
08-10 10:43:39.739 9015-9015/system_process I/ActivityManager﹕ START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.mylib.app/.MyActivity u=0} from pid 19237
08-10 10:43:39.791 9015-9025/system_process I/ActivityManager﹕ Start proc com.example.mylib.app for activity com.example.mylib.app/.MyActivity: pid=19247 uid=10048 gids={3003, 1028}
After stepping through addAccountExplicitly():
08-10 10:45:56.479 9015-9270/system_process V/AccountManagerService﹕ addAccount: Account {name=100, type=com.example.mylib.provider.ACCOUNT}, caller's uid 10048, pid 19247
08-10 10:45:56.479 9015-9270/system_process V/AccountManagerService﹕ caller uid 10048 has android.permission.AUTHENTICATE_ACCOUNTS
08-10 10:45:56.479 9015-9270/system_process W/AccountManagerService﹕ caller uid 10048 is different than the authenticator's uid
Packages Dump
The interesting snippets from /data/system/packages.xml seem to be alright:
...
<package name="com.example.mylib.app"
codePath="/data/app/com.example.mylib.app-1.apk"
nativeLibraryPath="/data/data/com.example.mylib.app/lib"
flags="0" ft="14f170308d8" it="14f16d8b51b" ut="14f17030a42" version="1"
sharedUserId="10048">
<sigs count="1">
<cert index="4" />
</sigs>
<perms />
</package>
...
<shared-user name="com.example.mylib" userId="10048">
<sigs count="1">
<cert index="4" />
</sigs>
<perms>
<item name="android.permission.READ_SYNC_SETTINGS" />
<item name="android.permission.MANAGE_ACCOUNTS" />
<item name="android.permission.USE_CREDENTIALS" />
<item name="android.permission.WRITE_SYNC_SETTINGS" />
<item name="android.permission.GET_ACCOUNTS" />
<item name="android.permission.INTERNET" />
<item name="android.permission.AUTHENTICATE_ACCOUNTS" />
</perms>
</shared-user>
Project Manifests
Library project's mylib_authenticator.xml:
<?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="com.example.mylib"
android:accountType="com.example.mylib.provider.ACCOUNT"
android:exported="true"
android:label="#string/service_name"/>
Library project's mylib_syncadapter.xml:
<?xml version="1.0" encoding="utf-8"?>
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="com.example.mylib"
android:contentAuthority="com.example.mylib.provider"
android:accountType="com.example.mylib.provider.ACCOUNT"
android:userVisible="false"
android:exported="true"
android:supportsUploading="false"
android:allowParallelSyncs="false"
android:isAlwaysSyncable="true"
/>
Interesting bits from the library project's AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mylib"
android:sharedUserId="com.example.mylib">
<application>
<provider
android:name="com.example.mylib.provider.MyContentProvider"
android:authorities="com.example.mylib.provider"
android:exported="true"
android:syncable="true"/>
<service
android:name="com.example.mylib.service.SyncService"
android:exported="true"
android:process=":sync">
<intent-filter>
<action android:name="android.content.SyncAdapter"/>
</intent-filter>
<meta-data android:name="android.content.SyncAdapter"
android:resource="#xml/mylib_syncadapter" />
</service>
<service android:name="com.example.mylib.service.AccountService"
android:exported="true">
<intent-filter>
<action android:name="android.content.AccountAuthenticator"/>
</intent-filter>
<meta-data android:name="android.content.AccountAuthenticator"
android:resource="#xml/mylib_authenticator" />
</service>
</application>
Interesting bits from app project's AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mylib.app"
android:sharedUserId="com.example.mylib">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
<application ...>
<activity ... />
</application>
</manifest>
Related
I am having this error
I/Ads (21352): Starting ad request.
I/Ads (21352): SDK version: afma-sdk-a-v15090040.14300000.1
I/Ads (21352): This request is sent from a test device.
W/Ads (21352): Could not find com.google.android.gms.ads.AdActivity, please make sure it is declared in AndroidManifest.xml.
W/Ads (21352): Missing AdActivity with android:configChanges in AndroidManifest.xml. You must have the following declaration within the <application> element: <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
D/skia (21352): Program linking failed.
D/skia (21352): Program linking failed.
I tried to resolve the issue as per mentioned in this missing-adactivity-with-android-configchanges and AdView - Missing adActivity with android:configChanges in AndroidManifest.xml but it having same issue.
in profile/AndroidManifest I have
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="puns.jokes.org.jokespuns">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
in main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="puns.jokes.org.jokespuns">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Jokes and Puns"
android:icon="#mipmap/ic_launcher">
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-<app-id>"/>
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
What I am doing wrong here?
I was receiving the same error.
My solution to this problem was to update in the grandle build at the application level.
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.google.gms: google-services: 4.2.0'
My AndroidManifest:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-***********~**********"/>
I hope it helps. regards
I'm getting some SecurityException's in my app, presumably due to missing permissions. It happens very rarely and doesn't seem to be consistent, kind of a 'once in a blue moon' thing. I haven't got access to any of the devices that it's crashed on. It seems to happen across different manufacturer, and android versions.
What i've done so far, is check my AndroidManifest.xml for <uses-permission> and that it's in the right scope, as an immediate child of <mainfest> and everything seems fine. Below is my AndroidManifest.xml - shortened a bit for readability. And i've tried to google it, and I've found a similare issue on Google Groups, which also seems to be unsolved: https://groups.google.com/forum/#!topic/android-c2dm/QIjbqO38rHI
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eTilbudsavis.eTilbudsavis" >
<!-- SOME PERMISSIONS E.T.C. REMOVED FOR READABILITY -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- THE PERMISSION'S THAT CAUSES CRASHES -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<application
android:name="com.eTilbudsavis.eTilbudsavis.App"
android:allowBackup="true"
android:icon="#drawable/ic_app"
android:label="#string/app_name" >
<activity
android:name="com.eTilbudsavis.eTilbudsavis.MainActivity"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:label="#string/app_name"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.eTilbudsavis.eTilbudsavis.test.TestActivity" >
</activity>
<!-- ACTIVITIES, SERVICES, RECIEVERS REMOVED FOR READABILITY -->
</application>
</manifest>
I've included a couple of stack traces, that I have from out crash reporter along with device info.
The first missing com.google.android.c2dm.permission.RECEIVE which is in the manifest. Devices: Sony Xperia Z1 Compact (D5503, running android 5.0.2) and Samsung Galaxy S III (I9300, running Android 4.3).
java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } without permission com.google.android.c2dm.permission.RECEIVE
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1730)
at android.app.ContextImpl.startService(ContextImpl.java:1707)
at android.content.ContextWrapper.startService(ContextWrapper.java:515)
at com.google.android.gms.gcm.GoogleCloudMessaging.zzs()
at com.google.android.gms.gcm.GoogleCloudMessaging.register()
at com.eTilbudsavis.eTilbudsavis.notification.GcmRegistration.run(GcmRegistration.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Second one is missing android.permission.ACCESS_NETWORK_STATE, which is also defined in the mainfest. Devices: Huawei Ascend P7 (P7-L10, running Android 4.4.2)
java.lang.SecurityException: ConnectivityService: Neither user 10184 nor current process has android.permission.ACCESS_NETWORK_STATE.
at android.os.Parcel.readException(Parcel.java:1475)
at android.os.Parcel.readException(Parcel.java:1429)
at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo(IConnectivityManager.java:843)
at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:635)
at com.eTilbudsavis.eTilbudsavis.ConnectionChecker.isOnline(ConnectionChecker.java:67)
at com.eTilbudsavis.eTilbudsavis.ConnectionChecker.run(ConnectionChecker.java:42)
Third one Second one is missing android.permission.WRITE_EXTERNAL_STORAGE, which is also defined in the mainfest. Devices: Samsung Galaxy Tab S 8.4 (SM-T705, running Android 4.4.2)
java.lang.SecurityException: The Maps API requires the additional following permissions to be set in the AndroidManifest.xml to ensure a correct behavior:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
at com.google.maps.api.android.lib6.d.t.a()
at com.google.maps.api.android.lib6.d.ft.a()
at com.google.maps.api.android.lib6.d.aj.a()
at com.google.maps.api.android.lib6.d.ai.a()
at com.google.android.gms.maps.internal.x.onTransact(SourceFile:107)
at android.os.Binder.transact(Binder.java:361)
at com.google.android.gms.maps.internal.IMapFragmentDelegate$zza$zza.onCreateView()
at com.google.android.gms.maps.SupportMapFragment$zza.onCreateView()
at com.google.android.gms.dynamic.zza$4.zzb()
at com.google.android.gms.dynamic.zza.zza()
at com.google.android.gms.dynamic.zza.onCreateView()
at com.google.android.gms.maps.SupportMapFragment.onCreateView()
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1789)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:955)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:490)
at com.eTilbudsavis.eTilbudsavis.fragment.LocationMapFragment.ensureSupportMapFragment(LocationMapFragment.java:338)
at com.eTilbudsavis.eTilbudsavis.fragment.LocationMapFragment.onStart(LocationMapFragment.java:676)
at android.support.v4.app.Fragment.performStart(Fragment.java:1813)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:989)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:458)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
at java.lang.reflect.Method.invokeNative(Method.java)
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(NativeStart.java)
Any help is appreciated.
before I start, I want to emphasize that I read some answers and they don't help me. Like:
Duplicate problem ...
addAccountExplicitly throws IllegalStateException caused by Securityexception
SecurityException: caller uid XXXX is different than the authenticator's uid
...
like the title suggestes, I am trying to use AccountManager in an Activty under Application (not Service), but without sucess. I use an 4.3 emulator (Intel image). I can easly liist all accounts on the emulator (added via android interface) but when I want to create one an Error comes in:
09-14 13:21:21.863: E/AndroidRuntime(3291): java.lang.SecurityException: caller uid 10046 is different than the authenticator's uid
09-14 13:21:21.863: E/AndroidRuntime(3291): at android.os.Parcel.readException(Parcel.java:1431)
09-14 13:21:21.863: E/AndroidRuntime(3291): at android.os.Parcel.readException(Parcel.java:1385)
09-14 13:21:21.863: E/AndroidRuntime(3291): at android.accounts.IAccountManager$Stub$Proxy.addAccountExplicitly(IAccountManager.java:719)
09-14 13:21:21.863: E/AndroidRuntime(3291): at android.accounts.AccountManager.addAccountExplicitly(AccountManager.java:612)
Here are my quick code snippets:
Login.java ->
public class Login extends AccountAuthenticatorActivity {
...
protected void onCreate(Bundle savedInstanceState) {
...
AccountManager accountmanager = AccountManager.get(this);
Account userAccount = new Account(“Test”, “test.activities”);
if (accountmanager.addAccountExplicitly(userAccount, “pass”, null))
System.out.println(“Added success”);
else System.out.println(“Added failed”);
}
...
}
res/xml/authenticator.xml
<?xml version="1.0" encoding="utf-8"?>
<account-authenticator
xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="test.activities"
android:icon="#drawable/ic_launcher"
android:smallIcon="#drawable/ic_launcher"
android:label="#string/app_name"
/>
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xxxx"
android:versionCode="1"
android:versionName="1.0"
>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.USE_CREDENTIALS"></uses-permission>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:name="Application"
android:allowBackup="true"
android:icon="#drawable/cg_icon_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
>
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator" />
...
</application>
</manifest>
Tried it on 2.2 Android phone and the error is the same. I can succesfully list all the Accounts although (with Account[] accounts = accountmanager.getAccounts();).
I also tried this app https://play.google.com/store/apps/details?id=com.udinic.accounts_example and can add the account with it. But via my application, no success.
am having a little trouble here. i don't know why i am getting a SecurityException, when trying to install my AppWidget on the home screen?. i don't know what will help to solve this but here is the simplified logcat output and my Android Manifest for starters:
11-30 18:02:16.454: ERROR/AndroidRuntime(287): Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.appwidget.action.APPWIDGET_CONFIGURE cmp=com.MuchachaApps.WeatherViewer/.WeatherForecastConfigure (has extras) } from ProcessRecord{44e58dc8 287:android.process.acore/10001} (pid=287, uid=10001) requires null
11-30 18:02:16.454: ERROR/AndroidRuntime(287):atandroid.os.Parcel.readException(Parcel.java:1218)
113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.os.Parcel.readException(Parcel.java:1206)
113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1214)
113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.Activity.startActivityForResult(Activity.java:2749)
113018:02:16.454:ERROR/AndroidRuntime(287):atcom.android.launcher.Launcher.startActivityForResult(Launcher.java:969)
113018:02:16.454:ERROR/AndroidRuntime(287):atcom.android.launcher.Launcher.addAppWidget(Launcher.java:1148)
113018:02:16.454:ERROR/AndroidRuntime(287):atcom.android.launcher.Launcher.onActivityResult(Launcher.java:379)
113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.Activity.dispatchActivityResult(Activity.java:3828)
113018:02:16.454:ERROR/AndroidRuntime(287):atandroid.app.ActivityThread.deliverResults(ActivityThread.java:3325)
11-30 18:02:16.454: ERROR/AndroidRuntime(287):... 11 more
My Android Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MuchaaApps.WeatherViewer"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<service android:name= "weatherForecast"></service>
<activity android:name=".WeatherForecastConfigure" android:label="#string/app_name"></activity>
<receiver android:name="WeatherWidgetProvider" android:label="Weather Forecast">
<intent-filter>
<action android:name= "android.appwidget.action.APPWIDGET_UPDATE"></action>
</intent-filter>
<intent-filter>
<action android:name="com.MuchaaApps.WeatherViewer.WEATHER_UPDATE"></action>
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="#xml/weather_appwidget_info"></meta-data>
</receiver>
</application>
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
if you need any other information, please let me know. Thank you
Do you have a configuration Activity that's supposed to come up when you add the widget to the launcher? If so, you need to add an APPWIDGET_CONFIGURE action to your intent-filter. If not, you need to remove the android:configure attribute from your appwidget-provider XML.
Having one but not the other is the problem.
I'm trying to make a ticker widget for BBC News, most of it was working perfectly well last night, but I had a few issues getting the permissions for the configuration activity correct. After re-writing my Manifest nothing works at all, despite being completely how it should be as far as I can tell.
Here's my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.news.bbcwidget"
android:versionCode="1"
android:versionName="101">
<application
android:label="#string/app_name"
android:icon="#drawable/logo"
android:permission="android.permission.INTERNET"
android:persistent="true"
android:debuggable="true"
android:enabled="true">
<activity
android:name="BBCWidgetConfig"
android:permission="android.permission.INTERNET">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<activity
android:name="Launcher"
android:permission="android.permission.INTERNET" />
<receiver
android:name="BBCNewsWidget"
android:permission="android.permission.INTERNET">
<service
android:permission="android.permission.INTERNET"
android:name="BBCNewsService" />
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:resource="#xml/bbcnews"
android:name="android.appwidget.provider" />
</receiver>
<service android:name="BBCNewsWidget$BBCNewsService" />
</application>
</manifest>
and here are the key bits of the errors received:
06-19 20:06:34.339: WARN/ActivityManager(58): Permission Denial: Accessing service ComponentInfo{com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget$BBCNewsService} from pid=58, uid=1000 requires android.permission.INTERNET
06-19 20:06:34.529: ERROR/AndroidRuntime(247): java.lang.RuntimeException: Unable to start receiver com.news.bbcwidget.BBCNewsWidget: java.lang.SecurityException: Not allowed to start service Intent { cmp=com.news.bbcwidget/.BBCNewsWidget$BBCNewsService } without permission android.permission.INTERNET
06-19 20:06:34.529: ERROR/AndroidRuntime(247): Caused by: java.lang.SecurityException: Not allowed to start service Intent { cmp=com.news.bbcwidget/.BBCNewsWidget$BBCNewsService } without permission android.permission.INTERNET
06-19 20:10:51.558: WARN/ActivityManager(58): Permission Denial: broadcasting Intent { act=android.appwidget.action.APPWIDGET_DELETED cmp=com.news.bbcwidget/.BBCNewsWidget (has extras) } from android (pid=113, uid=10000) requires android.permission.INTERNET due to receiver com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget
06-19 20:10:51.558: WARN/ActivityManager(58): Permission Denial: broadcasting Intent { act=android.appwidget.action.APPWIDGET_DISABLED cmp=com.news.bbcwidget/.BBCNewsWidget } from android (pid=113, uid=10000) requires android.permission.INTERNET due to receiver com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget
It was previously giving "bad process" errors but that seems to have stopped now. From what I understand the Manifest is giving android.permission.INTERNET to all of my services, activities and the AppWidgetProvider, so I don't understand why this is happening. it used to work before!
Cheers!
Add
<uses-permission
android:name="android.permission.INTERNET"></uses-permission>
To your manifest node and not to the activities
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.news.bbcwidget"
android:versionCode="1"
android:versionName="101">
<application
....
</application>
<uses-permission
android:name="android.permission.INTERNET"></uses-permission>
</manifest>