【发布时间】:2015-02-19 10:15:12
【问题描述】:
ParseApplication 首先向 ParseApplication.java 添加键是好的,但是在 sdk 测试后设备中显示错误 “不幸的是,parseStarterProject 已停止工作”
这是我的 ParseApplication.java 文件
package com.parse.starter;
import android.app.Application;
import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseCrashReporting;
import com.parse.ParseObject;
import com.parse.ParseUser;
public class ParseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Initialize Crash Reporting.
ParseCrashReporting.enable(this);
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
//copy and paste frome parse.com
// Parse.initialize(this, YOUR_APPLICATION_ID, YOUR_CLIENT_KEY);
Parse.initialize(this, "oaXYWiKShMVJ0VqZ52zwVnzpNlC3CKEReLV5wANX", "BiHRJalzAGYgFmh250SDxBxxi8DaIdnsnfunBfpC");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
// defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
ParseObject testObject = new ParseObject("TestObject");
testObject.put("foo", "bar");
testObject.saveInBackground();
}
}
另一个,ParseStarterProjectActivity.java 文件是
package com.parse.starter;
import android.app.Activity;
import android.os.Bundle;
import com.parse.ParseAnalytics;
public class ParseStarterProjectActivity extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ParseAnalytics.trackAppOpenedInBackground(getIntent());
}
}
这是在 android studio 中做的,它是 parse.com “get start project”的启动项目
【问题讨论】:
-
你有堆栈跟踪吗?
-
请帮我解决这个问题
-
好吧,刚才我在 logcat
Caused by: java.lang.IllegalArgumentException: cannot setReadAccess for a user with null id中看到了堆栈跟踪,请先生找出来 -
你可以查看这个链接,它对我有帮助。 stackoverflow.com/questions/25881052/…
-
在此处查看我的答案 [我在下面链接中的答案已为我修复。][1] [1]:stackoverflow.com/questions/26335368/…
标签: java android parse-platform