Cannot resolve symbol 'HmsMessageService' in android stuido


I am trying to implement push notifications for Huawei.

For that I am following this toturial:

But on step 8, when I implement this:

public class MyPushService extends HmsMessageService {
private static final String TAG = "PushDemoLog";
public void onNewToken(String token) {
    Log.i(TAG, "receive token:" + token);


I get this error on HmsMessageService.

Cannot resolve symbol ‘HmsMessageService’

I have added all dependencies as referred in the article. Have installed the hmstoolkitsdk-tool,

This are my Build gradle dependencies:
enter image description here

How can i resolve this error?



The following is Huawei Push demo, You are advised to follow the step by step :

Answered By – zhangxaochen

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published