java 导入 com.google.android.gcm.GCMRegistrar;

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14932296/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 17:54:25  来源:igfitidea点击:

importing com.google.android.gcm.GCMRegistrar;

javagoogle-cloud-messaging

提问by Imri Persiado

I'm trying to create GCM based application. I followed the instructions as described in here.

我正在尝试创建基于 GCM 的应用程序。我按照此处所述的说明进行操作。

In step number 4 I need to import the following line:

在第 4 步中,我需要导入以下行:

import com.google.android.gcm.GCMRegistrar;

But I get an error: enter image description here

但我收到一个错误: 在此处输入图片说明

As I said I followed all the steps, any idea why did it happend?

正如我所说,我遵循了所有步骤,知道为什么会发生这种情况吗?

回答by Rais Alam

Follow below steps

按照以下步骤操作

  1. create a lib folder under the project
  2. put all jar files in lib folder
  3. expand lib folder select all jars
  4. right click then buildpath and select add to build path option
  1. 在项目下创建一个lib文件夹
  2. 将所有 jar 文件放在 lib 文件夹中
  3. 展开 lib 文件夹选择所有 jars
  4. 右键单击然后构建路径并选择添加到构建路径选项

回答by mtk

Right click the project and Add to build path-

右键单击项目并添加以构建路径-

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明