Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 10-23 10:18:18.945: E/AndroidRuntime(8987): java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.gms.analytics.service.START (has extras) }
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="xxxxx.android.phone.xxxxx"
- android:versionCode="3"
- android:versionName="v1.2.4065" >
- <uses-sdk android:minSdkVersion="12"
- android:targetSdkVersion="21" />
- <!-- Required for Google Analytics -->
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
- <!-- For push notifications (GCM) -->
- <permission android:name="xxxxx.android.phone.xxxxx.permission.C2D_MESSAGE" android:protectionLevel="signature" />
- <uses-permission android:name="xxxxx.android.phone.xxxxx.permission.C2D_MESSAGE" />
- <!-- App receives GCM messages. -->
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
- <!-- GCM connects to Google Services. -->
- <uses-permission android:name="android.permission.INTERNET" />
- <!-- GCM requires a Google account. -->
- <uses-permission android:name="android.permission.GET_ACCOUNTS" />
- <!-- Keeps the processor from sleeping when a message is received. -->
- <uses-permission android:name="android.permission.WAKE_LOCK" />
- <!-- GCM - We handle notifications differently if the app is running -->
- <uses-permission android:name="android.permission.GET_TASKS" />
- <!-- Caching -->
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <!-- The event subscribe button adds events to the calendar -->
- <!-- <uses-permission android:name="android.permission.WRITE_CALENDAR" /> -->
- <!-- <uses-permission android:name="android.permission.READ_CALENDAR" /> -->
- <supports-screens
- android:resizeable="true"
- android:smallScreens="false"
- android:normalScreens="true"
- android:largeScreens="true"
- android:xlargeScreens="true"
- android:anyDensity="true" />
- <application
- android:name="xxxxx.xxxxxApplication"
- android:icon="@drawable/app_icon"
- android:label="@string/app_name"
- android:allowBackup="true"
- android:largeHeap="true" >
- <receiver
- android:name="com.google.android.gcm.GCMBroadcastReceiver"
- android:permission="com.google.android.c2dm.permission.SEND" >
- <intent-filter>
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
- <category android:name="xxxxx.android.phone.xxxxx" />
- </intent-filter>
- <intent-filter>
- <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
- <category android:name="xxxxx.android.phone.xxxxx" />
- </intent-filter>
- </receiver>
- <receiver
- android:name="xxxxx.ConnectivityReceiver"
- android:enabled="false" >
- <intent-filter>
- <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
- </intent-filter>
- </receiver>
- <activity
- android:name=".SplashActivity"
- android:configChanges="locale|orientation"
- android:theme="@style/Theme.Splash"
- android:screenOrientation="portrait"
- android:noHistory="true" >
- <intent-filter >
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity
- android:label="@string/app_name"
- android:theme="@style/Theme"
- android:windowSoftInputMode="adjustPan|stateVisible"
- android:name=".LoginActivity"
- android:configChanges="locale|orientation|screenSize"
- android:screenOrientation="portrait" >
- </activity>
- <activity
- android:name=".MainActivity"
- android:theme="@style/Theme"
- android:configChanges="locale|orientation|screenSize"
- android:screenOrientation="portrait"
- android:windowSoftInputMode="adjustPan|stateVisible" />
- <activity
- android:name=".CountryPickerActivity"
- android:theme="@style/Theme.Floating"
- android:configChanges="locale|orientation|screenSize"
- android:screenOrientation="portrait"
- android:windowSoftInputMode="adjustPan|stateVisible" />
- <activity
- android:name=".EventPickerActivity"
- android:theme="@style/Theme.Floating"
- android:configChanges="locale|orientation|screenSize"
- android:screenOrientation="portrait"
- android:windowSoftInputMode="adjustPan|stateVisible" />
- <activity
- android:name=".TutorialActivity"
- android:theme="@style/Theme.Transparent"
- android:configChanges="locale|orientation|screenSize"
- android:screenOrientation="portrait" />
- <activity
- android:name=".VideoPlayerActivity"
- android:theme="@style/Theme"
- android:configChanges="orientation|screenSize" />
- <service android:name=".GCMIntentService" android:enabled="true" />
- <meta-data android:name="com.crashlytics.ApiKey" android:value="xxxxxxxxxxxxxxxx"/>
- </application>
- </manifest>
- public class GCMIntentService extends GCMBaseIntentService {
- private static final int ATTEMPTS_MAX = 3;
- final static boolean USE_DEV = false;
- final static String XXXXX = "https://xxxxx/api.php";
- final static String XXXXX = "http://dev.xxxxx/api.php";
- final static String SUBSCRIPTION_KEY = "xxxxxxxxxxxxxxx"; // unique per app
- public GCMIntentService() {
- super(xxxxxx.SENDER_ID);
- if(GCMIntentService.USE_DEV) {
- host = XXXXX;
- } else {
- host = XXXXX;
- }
- }
- ...
- }
- 10-23 13:17:08.095: E/AndroidRuntime(10560): FATAL EXCEPTION: GAThread
- 10-23 13:17:08.095: E/AndroidRuntime(10560): Process: xxxxx.android.phone.xxxxx, PID: 10560
- 10-23 13:17:08.095: E/AndroidRuntime(10560): java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.gms.analytics.service.START (has extras) }
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1674)
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1773)
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at android.app.ContextImpl.bindService(ContextImpl.java:1751)
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at android.content.ContextWrapper.bindService(ContextWrapper.java:538)
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at com.google.analytics.tracking.android.AnalyticsGmsCoreClient.connect(AnalyticsGmsCoreClient.java:82)
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at com.google.analytics.tracking.android.GAServiceProxy.connectToService(GAServiceProxy.java:279)
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at com.google.analytics.tracking.android.GAServiceProxy.createService(GAServiceProxy.java:163)
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at com.google.analytics.tracking.android.GAThread.init(GAThread.java:95)
- 10-23 13:17:08.095: E/AndroidRuntime(10560): at com.google.analytics.tracking.android.GAThread.run(GAThread.java:493)
- // explicit Intent, safe
- Intent serviceIntent = new Intent(ILicensingService.class.getName());
- serviceIntent.setPackage("com.android.vending");
- boolean bindResult = mContext.bindService(serviceIntent, this, Context.BIND_AUTO_CREATE);
- com.google.android.vending.licensing.LicenseChecker.checkAccess(LicenseChecker.java:150)
- new String(
- - Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U="))),
- + Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")))
- + .setPackage("com.android.vending"), // this fix the 'IllegalArgumentException: Service Intent must be explicit'
- this, // ServiceConnection.
- Intent startIntent = new Intent(this, ServiceToStart.class);
- this.startService(startIntent); // or bindService(...)
- public static Intent createExplicitFromImplicitIntent(Context context, Intent implicitIntent) {
- //Retrieve all services that can match the given intent
- PackageManager pm = context.getPackageManager();
- List<ResolveInfo> resolveInfo = pm.queryIntentServices(implicitIntent, 0);
- //Make sure only one match was found
- if (resolveInfo == null || resolveInfo.size() != 1) {
- return null;
- }
- //Get component info and create ComponentName
- ResolveInfo serviceInfo = resolveInfo.get(0);
- String packageName = serviceInfo.serviceInfo.packageName;
- String className = serviceInfo.serviceInfo.name;
- ComponentName component = new ComponentName(packageName, className);
- //Create a new intent. Use the old one for extras and such reuse
- Intent explicitIntent = new Intent(implicitIntent);
- //Set the component to be explicit
- explicitIntent.setComponent(component);
- return explicitIntent;
- }
- Intent serviceIntent = new Intent(new String(
- Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")));
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- serviceIntent.setPackage("com.android.vending");
- }
- boolean bindResult =
- mContext.bindService(
- serviceIntent,
- this, // ServiceConnection.
- Context.BIND_AUTO_CREATE);
- Intent intent = new Intent(this, Class.forName(ServiceClassName.class.getName()));
- bindService(intent,serviceConnection, Service.BIND_AUTO_CREATE);
- var intent = new Intent (this,typeof(MyBoundService));
- var serviceConnection = new MyBindServiceConnection (this);
- BindService (intent, serviceConnection, Bind.AutoCreate);
Add Comment
Please, Sign In to add comment