所以我正在尝试在我的Nexus 6上进行调试.我无法通过手机打开RSA密钥验证.它可以立即在我的朋友macbook上使用相同的电缆
有人有主意吗?我几乎把头发拉了出来.:(
我正在制作一个使用 Facebook 登录的应用程序。我可以单独登录,但现在将其与我的其他活动集成时,它无法登录。它带有错误消息“抱歉,出了点问题。我们正在处理它,我们会尽快修复它”,然后我按回键,它正确地显示登录已被取消,所以我知道它能做到那么远。任何人都可以看到出了什么问题吗?我正在家用电脑和笔记本电脑上处理同一个项目。这是否会以某种方式弄乱我的 strings.xml 中的 facebook-id ?
MainActivity.java
package com.example.nan.spymap;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.login.LoginResult;
import com.facebook.login.widget.LoginButton;
public class MainActivity extends Activity {
private CallbackManager callbackManager;
private TextView info;
private LoginButton loginButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
callbackManager = CallbackManager.Factory.create();
setContentView(R.layout.activity_main);
setContentView(R.layout.activity_main);
info = (TextView)findViewById(R.id.info);
loginButton = (LoginButton)findViewById(R.id.login_button);
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
startActivity(new Intent(MapActivity.this, …Run Code Online (Sandbox Code Playgroud) 所以我有一个类,其中一个函数依赖于另一个函数。该类与模块一起导出。根据我能找到的任何内容,我应该能够使用“this”,但这会引发错误。
例子:
class Test{
test(){
console.log('hello');
}
dependentMethod(){
this.test();
}
}
module.exports = Test;
Run Code Online (Sandbox Code Playgroud)
然而,这会在节点中引发这些错误:
(node:69278) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'test' of undefined
(node:69278) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:69278) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'test' of undefined
Run Code Online (Sandbox Code Playgroud)
如果我把这个函数放在类之外,它会工作得很好。谁能解释为什么会失败?:)
编辑:
这是 server.js 中使用该类的代码(针对示例进行了简化):
const test = …Run Code Online (Sandbox Code Playgroud)