运行 Android 项目时出现此错误:
com.android.ddmlib.AdbCommandRejectedException:在 com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373) 在 com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:752) 上找不到设备。 ddmlib.Device.executeShellCommand(Device.java:462) at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:109) at java.lang.Thread.run(Unknown Source)
当我检查代码时,当我评论这个代码块时,我达到了:
public class ElarabyGroup extends Activity {
private String TAG ;
private String SENDER_ID = "123456789123";
private WebView webView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_elaraby_group);
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
GCMRegistrar.register(this, SENDER_ID);
} else {
Log.v(TAG, "Already registered");
}
错误已完成,但我无法在我的项目中使用 GCM。请帮忙。