Gradle setting problem with sending notification via firebase in Android studio
I tried to enable the sending notification function in my android app via Firebase. Following the tutorials, I added the following code in my AndroidManifest.xml, application tag.
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="id:XXXXXX" />
<service
android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
I also added in the following code in my app build.gradle file, dependency section:
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
The app build.gradle file looks like:
apply plugin: 'com.android.application'
android
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig
applicationId "edu.pitt.cs.mips.coursemirror"
minSdkVersion 19
targetSdkVersion 27
buildTypes
release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
dependencies
compile files('libs/Parse-1.13.0.jar')
compile files('libs/ParseInterceptors-0.0.2.jar')
compile files('libs/android-pusher-0.6.jar')
compile files('libs/bolts-tasks-1.4.0-javadoc.jar')
compile files('libs/bolts-tasks-1.4.0.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/otto-1.3.4.jar')
compile files('libs/picasso-1.1.1.jar')
compile files('libs/retrofit-1.5.1.jar')
compile files('libs/volley.jar')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:appcompat-v7:27+'
compile 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
repositories
mavenCentral()
jcenter()
maven url 'https://jitpack.io'
repositories
mavenLocal()
mavenCentral()
maven
url 'https://maven.google.com/'
apply plugin: 'com.google.gms.google-services'
However, after sync the gradle, there are errors in AndroidManifest.xml:
<service
android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
The errors are: unresolved package 'fcm', and Unresolved class 'ParseFirebaseMessagingService' and 'ParseFirebaseInstanceIdService'. And when I run the code, the push notification function from website and in-app both don't work.
To solve this problem, I include the following code in build.gradle file dependency section:
implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.18.5"
However, after sync with this update, when ran the app, it reports the error: "Multiple dex files define Lbolts/Task$UnobservedExceptionHandler;"
Anyone knows how to solve this problem? Thanks a lot!
android firebase parsing push-notification
add a comment |
I tried to enable the sending notification function in my android app via Firebase. Following the tutorials, I added the following code in my AndroidManifest.xml, application tag.
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="id:XXXXXX" />
<service
android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
I also added in the following code in my app build.gradle file, dependency section:
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
The app build.gradle file looks like:
apply plugin: 'com.android.application'
android
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig
applicationId "edu.pitt.cs.mips.coursemirror"
minSdkVersion 19
targetSdkVersion 27
buildTypes
release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
dependencies
compile files('libs/Parse-1.13.0.jar')
compile files('libs/ParseInterceptors-0.0.2.jar')
compile files('libs/android-pusher-0.6.jar')
compile files('libs/bolts-tasks-1.4.0-javadoc.jar')
compile files('libs/bolts-tasks-1.4.0.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/otto-1.3.4.jar')
compile files('libs/picasso-1.1.1.jar')
compile files('libs/retrofit-1.5.1.jar')
compile files('libs/volley.jar')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:appcompat-v7:27+'
compile 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
repositories
mavenCentral()
jcenter()
maven url 'https://jitpack.io'
repositories
mavenLocal()
mavenCentral()
maven
url 'https://maven.google.com/'
apply plugin: 'com.google.gms.google-services'
However, after sync the gradle, there are errors in AndroidManifest.xml:
<service
android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
The errors are: unresolved package 'fcm', and Unresolved class 'ParseFirebaseMessagingService' and 'ParseFirebaseInstanceIdService'. And when I run the code, the push notification function from website and in-app both don't work.
To solve this problem, I include the following code in build.gradle file dependency section:
implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.18.5"
However, after sync with this update, when ran the app, it reports the error: "Multiple dex files define Lbolts/Task$UnobservedExceptionHandler;"
Anyone knows how to solve this problem? Thanks a lot!
android firebase parsing push-notification
Did you solve this issue? I have the same problem on my end also.
– U Khan
Nov 25 '18 at 9:15
Not really. Instead, I downgraded all the versions.
– Wei G
Nov 27 '18 at 2:59
add a comment |
I tried to enable the sending notification function in my android app via Firebase. Following the tutorials, I added the following code in my AndroidManifest.xml, application tag.
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="id:XXXXXX" />
<service
android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
I also added in the following code in my app build.gradle file, dependency section:
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
The app build.gradle file looks like:
apply plugin: 'com.android.application'
android
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig
applicationId "edu.pitt.cs.mips.coursemirror"
minSdkVersion 19
targetSdkVersion 27
buildTypes
release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
dependencies
compile files('libs/Parse-1.13.0.jar')
compile files('libs/ParseInterceptors-0.0.2.jar')
compile files('libs/android-pusher-0.6.jar')
compile files('libs/bolts-tasks-1.4.0-javadoc.jar')
compile files('libs/bolts-tasks-1.4.0.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/otto-1.3.4.jar')
compile files('libs/picasso-1.1.1.jar')
compile files('libs/retrofit-1.5.1.jar')
compile files('libs/volley.jar')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:appcompat-v7:27+'
compile 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
repositories
mavenCentral()
jcenter()
maven url 'https://jitpack.io'
repositories
mavenLocal()
mavenCentral()
maven
url 'https://maven.google.com/'
apply plugin: 'com.google.gms.google-services'
However, after sync the gradle, there are errors in AndroidManifest.xml:
<service
android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
The errors are: unresolved package 'fcm', and Unresolved class 'ParseFirebaseMessagingService' and 'ParseFirebaseInstanceIdService'. And when I run the code, the push notification function from website and in-app both don't work.
To solve this problem, I include the following code in build.gradle file dependency section:
implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.18.5"
However, after sync with this update, when ran the app, it reports the error: "Multiple dex files define Lbolts/Task$UnobservedExceptionHandler;"
Anyone knows how to solve this problem? Thanks a lot!
android firebase parsing push-notification
I tried to enable the sending notification function in my android app via Firebase. Following the tutorials, I added the following code in my AndroidManifest.xml, application tag.
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="id:XXXXXX" />
<service
android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
I also added in the following code in my app build.gradle file, dependency section:
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
The app build.gradle file looks like:
apply plugin: 'com.android.application'
android
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig
applicationId "edu.pitt.cs.mips.coursemirror"
minSdkVersion 19
targetSdkVersion 27
buildTypes
release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
dependencies
compile files('libs/Parse-1.13.0.jar')
compile files('libs/ParseInterceptors-0.0.2.jar')
compile files('libs/android-pusher-0.6.jar')
compile files('libs/bolts-tasks-1.4.0-javadoc.jar')
compile files('libs/bolts-tasks-1.4.0.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/otto-1.3.4.jar')
compile files('libs/picasso-1.1.1.jar')
compile files('libs/retrofit-1.5.1.jar')
compile files('libs/volley.jar')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:appcompat-v7:27+'
compile 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
repositories
mavenCentral()
jcenter()
maven url 'https://jitpack.io'
repositories
mavenLocal()
mavenCentral()
maven
url 'https://maven.google.com/'
apply plugin: 'com.google.gms.google-services'
However, after sync the gradle, there are errors in AndroidManifest.xml:
<service
android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
The errors are: unresolved package 'fcm', and Unresolved class 'ParseFirebaseMessagingService' and 'ParseFirebaseInstanceIdService'. And when I run the code, the push notification function from website and in-app both don't work.
To solve this problem, I include the following code in build.gradle file dependency section:
implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.18.5"
However, after sync with this update, when ran the app, it reports the error: "Multiple dex files define Lbolts/Task$UnobservedExceptionHandler;"
Anyone knows how to solve this problem? Thanks a lot!
android firebase parsing push-notification
android firebase parsing push-notification
asked Nov 12 '18 at 15:15
Wei GWei G
286
286
Did you solve this issue? I have the same problem on my end also.
– U Khan
Nov 25 '18 at 9:15
Not really. Instead, I downgraded all the versions.
– Wei G
Nov 27 '18 at 2:59
add a comment |
Did you solve this issue? I have the same problem on my end also.
– U Khan
Nov 25 '18 at 9:15
Not really. Instead, I downgraded all the versions.
– Wei G
Nov 27 '18 at 2:59
Did you solve this issue? I have the same problem on my end also.
– U Khan
Nov 25 '18 at 9:15
Did you solve this issue? I have the same problem on my end also.
– U Khan
Nov 25 '18 at 9:15
Not really. Instead, I downgraded all the versions.
– Wei G
Nov 27 '18 at 2:59
Not really. Instead, I downgraded all the versions.
– Wei G
Nov 27 '18 at 2:59
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265063%2fgradle-setting-problem-with-sending-notification-via-firebase-in-android-studio%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265063%2fgradle-setting-problem-with-sending-notification-via-firebase-in-android-studio%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you solve this issue? I have the same problem on my end also.
– U Khan
Nov 25 '18 at 9:15
Not really. Instead, I downgraded all the versions.
– Wei G
Nov 27 '18 at 2:59