Kotlin Is Having Trouble With Google Play Services. Please Try Again
Troubleshooting Steps
Check this page first for common issues based on Android Setup.
Try the instance projection on Github.
If stuck, contact support directly or email [email protected] for help.
For faster assist, delight provide:
- Your OneSignal App Id
- Details, logs, and/or screenshots of the issue.
- Steps to reproduce
Please follow all steps below. If you are nonetheless having problems, please reach out to support with a log generated following the steps beneath.
Render to the setup guide you followed in Mobile Push Quickstart to brand sure you lot followed all steps adding the OneSignal SDK to your app.
Native Android SDKs, brand sure you added the OneSignal init lawmaking inside the onCreate
method in your Application
class.
If you lot do not have an Application
Class, follow this guide.
After running through the rest of this Troubleshooting guide, use the OneSignal SDK setLogLevel method to Verbose to check the full logcat from the device when reproducing the behavior.
//The following options are available with increasingly more than data: //NONE, FATAL, Error, WARN, INFO, DEBUG, VERBOSE OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);
If you need help interpreting the logs, please share them equally a .txt file to help our support and engineering team aid you lot.
one. Select Android Monitor
from the lesser of the window.
------If you don't encounter this select it from View
> Tool Windows
> Android Monitor
2. Select your device from the driblet downward.
three. Ensure no filters are set and the type is fix to Verbose.
four. Select all lines in the log by pressing Control + A and and then re-create them.
five. Paste them into a .txt
file and ship this to support. Include steps to reproduce the problem as well.
1. adb logcat -b all -d -five threadtime > onesignal_crash_logcat.txt
2. Send the onesignal_crash_logcat.txt
to support. Include steps to reproduce the trouble as well.
If you don't take adb
in your path you will demand to fully path to adb
in the Android SDK. It is under <android-sdk>\platform-tools\adb
.
If y'all don't have the Android SDK installed you can only download the SDK Platform Tools which contains the adb
executable.
ANR errors occur when the main thread of your app is being blocked for over 5 seconds. You lot may encounter these occur forth with:
Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x11000010 pkg=YOUR.PACKAGE.NAME cmp=your.package.name/com.onesignal.FCMBroadcastReceiver (has extras) }
This simply shows how the app process started. This may appear to occur more ofttimes after adding OneSignal due to button notification received events starting your app process.
The best way to dig into these ANR problems is to check the total stacktrace of all threads.
Starting at the top of each stacktrace and working downwardly, it will help guide you on which upshot occurred concluding to trigger the ANR.
If you lot come across OneSignal in the actual stacktrace, delight make sure you are testing on the latest version of our SDK. Once you verify that is nonetheless happening, send the full stack trace of all threads with the ANR to [email protected] and we will help investigate.
The total log would almost probable exist in the low 1,000s of lines long. The log nosotros are looking for looks something like this.
Check if yous are calling our SDK Method: OneSignal.clearOneSignalNotifications();
or using the native Android method NotificationManagerCompat.from(context).cancelAll()
discussed hither.
The OneSignal Android Native SDK will reshow notifications that did not get interacted with. The user must click or dismiss the notification to not evidence it over again.
This ways that Android Studio or Gradle could not download our plugin. Delight check the post-obit.
1. Open your browser to http://search.maven.org/ to make sure it loads on your organisation.
2. Make certain you lot're using Android Studio version 1.4.0 or newer.
iii. Go to File
> Settings
.
4. Search for Offline work and uncheck this option.
5. Add the post-obit to your .gradle
file.
repositories { mavenCentral() }
six. Endeavor restarting Android Studio and then going to Tools
> Android
> Sync Project With Gradle Files
.
If yous are receiving the post-obit Android Studio mistake when edifice your projection
Error:Execution failed for task ':app:processDebugGoogleServices'. > Please gear up the version conflict either past updating the version of the google-services plugin (information most the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
Remove the following line from your .gradle
file.
apply plugin: 'com.google.gms.google-services'
This error ways yous added plugins { ... }
to the wrong spot in your app/build.gradle
. You must have the following 3 lines at the very summit of your file. Double check you don't accept duplicated lines as well.
buildscript { repositories { maven { url 'https://plugins.gradle.org/m2/'} } dependencies { classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.10.0, 0.99.99]' } } apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
Could not observe grade errors are expected in the logcat for Android devices before v.0. It is simply letting you know it could not find these classes as your app loads into retentiveness. It does non cause whatsoever bug in your app as the calls are guarded with runtime checks then they won't create any issues.
Failed to resolve: com.android.back up:customtabs:[26.0.0,26.1.0) Could non resolve all dependencies for configuration ':appName:'. > Could non notice whatsoever version that matches com.android.back up:customtabs:[26.0.0,26.2.0). Versions that practise not friction match: 26.0.0-alpha1 25.iii.1 + nineteen more than Required by: projection :appName > com.onesignal:OneSignal:three.half-dozen.0
Please utilize one of the Options below to resolve the consequence;
Add together the new Google Maven repo to your build.gradle
repositories { maven { url 'https://maven.google.com' } }
Too update compileSdkVersion
to 26
in your app/build.gradle
.
If you are not ready to update your project to the new back up library yet and are still using targetSdkVersion 25
or lower y'all tin can follow Option A or C in the section'southward instructions.
All gms/firebase libraries must use the exact aforementioned version (mixing versions tin pb to runtime crashes). Constitute versions xi.0.four, x.2.i. Examples include com.google.android.gms:play-services-base:11.0.four and com.google.android.gms:play-services-gcm:10.2.1.
OneSignal automatically adds the following dependencies;
-
com.google.android.gms
- Version 11.2.+ -
com.android.back up
- Version 26.1.+
To set this effect, all dependencies must be matching versions.
Add the OneSignal-Gradle-Plugin to your project.
Upgrade - Discover all com.google.android.gms
compile lines and update them to friction match.
// Update 9.0.0 to xi.two.+ and so information technology is using the same gms version as OneSignal compile 'com.google.android.gms:play-services-maps:9.0.0'
Downgrade - Force OneSignal'due south dependencies to a lower version.
// Supplant gmsVersion and/or androidSupportVersion with the versions you lot demand to downgrade to. def gmsVersion = 'eleven.ii.+' compile("com.google.android.gms:play-services-gcm:${gmsVersion}") { force = true } compile("com.google.android.gms:play-services-location:${gmsVersion}") { forcefulness = true } // Must use 26.0.0 or newer if you have targetSdkVersion 26 def androidSupportVersion = '26.ane.+' compile("com.android.support:support-v4:${androidSupportVersion}") { strength = true } compile("com.android.support:customtabs:${androidSupportVersion}") { forcefulness = truthful }
If you meet that some obfuscated Firebase or Google GMS methods are missing, it is most probably a dependency versioning conflict.
You tin can use the gradle dependencies
and gradle dependencyInsight
directives to troubleshoot which libraries are causing classes/methods to go missing. Refer to the official Gradle documentation for more than data:
https://docs.gradle.org/electric current/userguide/tutorial_gradle_command_line.html#sec:dependency_insight
For example:
./gradlew app:dependencyInsight --configuration compile
If you see the following error make sure you have completed step one.ii correctly.
Execution failed for job ':app:processDebugManifest' Manifest merger failed with multiple errors, run into logs
Make sure you lot added the code from stride 1.i of the Android Setup to the very top of the build.gradle file. This should exist the start line of code in the file.
Delight follow our No users on dashboard guide first.
Make sure yous have your Application in your AndroidManifest.xml
and add logging effectually OneSignal to make certain it is being called.
Make sure you have android:proper name=".ApplicationClass"
.
<awarding android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme android:name=".ApplicationClass">
public class ApplicationClass extends Awarding { @Override public void onCreate() { super.onCreate(); Log.d("OneSignalTag", "Before OneSignal init"); OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE); OneSignal.startInit(this).init(); Log.d("OneSignalTag", "After OneSignal init"); } }
- Make sure you have
onesignal_app_id
in yourbuild.gradle
and your id is correct.
android { defaultConfig { manifestPlaceholders = [onesignal_app_id: "PUT YOUR ONESIGNAL APP ID HERE", // Project number pulled from dashboard, local value is ignored. onesignal_google_project_number: "REMOTE"] } }
- Make certain you are non replacing the
<awarding>
tag in yourAndroidManifest.xml
withtools:node="supplant"
<application android:icon="@mipmap/ic_launcher" tools:node="replace" <!-- Remove this line!!! --> android:name=".ApplicationClass">
If you must replace some attributes please use tools:supercede
instead tools:node
.
Example: tools:replace="icon, characterization"
OneSignal automatically includes the following dependencies;
-
com.google.android.gms - Version 11.2.+
-
com.android.support - Version 26.1.+
Since these are commonly used by other SDKs you may run into issues due to conflicting versions. Add together the OneSignal-Gradle-Plugin to your project which will automatically resolve whatsoever conflicts.
one. Open your app/build.gradle
(Module: app) file, add the following to the top.
plugins { id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1' } apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
In Android Studio open up build.gradle (Module: app), make sure y'all have the post-obit plugins and the order is the same equally shown beneath:
utilise plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin' apply plugin: 'com.android.application'
In Android Studio open up build.gradle (Module: app), make sure to add together the following to the elevation of the file:
utilise plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin' utilize plugin: 'com.google.gms.google-services'
In Android Studio open build.gradle
(Module: app) and brand sure you are using the latest OneSignal SDK nether dependencies.
dependencies { compile 'com.onesignal:OneSignal:[3.half-dozen.0, 3.99.99]' }
Make sure you take compileSdkVersion
to 26
in your app/build.gradle
. This is required when you update to 26 of the Android Support Library.
If you're getting a conversion to dalvik format failed with mistake one
error with Dx bad class file magic (cafebabe) or version (0033.0000)
messages before this then you may accept the wrong Java version assault your organization. Meet the follow post to fix this likewise every bit the other answers.
http://stackoverflow.com/a/9041471/1244574
com.onesignal.NotificationOpenedReceiver is defined exactly similar this in the AndroidManifest.xml
Since at that place are no intent filters it's default is NOT exported outside of the app.
Encounter the Android documentation for this default behavior.
https://programmer.android.com/guide/topics/manifest/receiver-element#exported
"com.onesignal.UpgradeReceiver"
This is broadcast receiver is filter to android.intent.action.MY_PACKAGE_REPLACED which only the Android OS should exist able to fire. Likewise the Intent is not read, this is only used trigger an SDK task to put back whatever notifications to the shade after the app is updated as Android does not do this automatically.
Source: https://documentation.onesignal.com/docs/troubleshooting-android
0 Response to "Kotlin Is Having Trouble With Google Play Services. Please Try Again"
إرسال تعليق