2016-03-28 26 views
0

我已经从他们的网站 https://parse.com/docs/downloads 下载解析启动器项目,并在heroku上设置服务器,但是当我尝试运行该应用程序时,它只是崩溃。所有的配置变量都是正确的,彻底验证了它们。下面是这是完全正常,这是默认代码的代码(我运行Android工作室V1.5.1)在Android中解析

package com.parse.starter; 

import android.app.Application; 
import android.util.Log; 

import com.parse.Parse; 
import com.parse.ParseACL; 
import com.parse.ParseException; 
import com.parse.ParseObject; 
import com.parse.ParseUser; 
import com.parse.SaveCallback; 


public class StarterApplication extends Application { 

    @Override 
    public void onCreate() { 
    super.onCreate(); 

    // Enable Local Datastore. 
    Parse.initialize(new Parse.Configuration.Builder(getApplicationContext()) 
        .applicationId("instagram2EGB") 
        .clientKey("eugf236x") 
        .server("https://instagram2149.herokuapp.com/parse/") 
        .build() 
    ); 

    ParseObject gameScore = new ParseObject("GameScore"); 
    gameScore.put("score", 1337); 
    gameScore.put("playerName", "Sean Plott"); 
    gameScore.put("cheatMode", false); 
    gameScore.saveInBackground(new SaveCallback() { 
     public void done(ParseException e) { 
     if (e == null) { 
      Log.i("Parse", "Save Succeeded"); 
     } else { 
      Log.i("Parse", "Save Failed"); 
     } 
     } 
    }); 


    // Add your initialization code here 
    Parse.initialize(this); 

    ParseUser.enableAutomaticUser(); 
    ParseACL defaultACL = new ParseACL(); 
    // Optionally enable public read access. 
    // defaultACL.setPublicReadAccess(true); 
    ParseACL.setDefaultACL(defaultACL, true); 
    } 
} 

,这里是错误Error shown while running the app

+1

解析已关闭。选择另一种替代品 –

+0

解析的其他替代方法 –

+0

@salihkallai如果您已经在Heroku上设置了服务器,那么您会很好 - 您不依赖于Parse服务(闭幕2017年),但是在开放源Parse-Server项目。 – Ilya

回答

1
public class StarterApplication extends Application { 

    @Override 
    public void onCreate() { 
    super.onCreate(); 

    // Enable Local Datastore. 
    Parse.enableLocalDatastore(this); 

    // Add your initialization code here 
    Parse.initialize(new Parse.Configuration.Builder(getApplicationContext()) 
        .applicationId("instagram2EGB") 
        .clientKey("eugf236x") 
        .server("https://instagram2149.herokuapp.com/parse") 
        .build() 
    ); 

    ParseObject gameScore = new ParseObject("GameScore"); 
    gameScore.put("score", 1337); 
    gameScore.put("playerName", "Sean Plott"); 
    gameScore.put("cheatMode", false); 
    gameScore.saveInBackground(new SaveCallback() { 
     public void done(ParseException e) { 
     if (e == null) { 
      Log.i("Parse", "Save Succeeded"); 
     } else { 
      Log.i("Parse", "Save Failed"); 
     } 
     } 
    }); 


    ParseUser.enableAutomaticUser(); 
    ParseACL defaultACL = new ParseACL(); 
    // Optionally enable public read access. 
    // defaultACL.setPublicReadAccess(true); 
    ParseACL.setDefaultACL(defaultACL, true); 
    } 
} 
0

即使解析一次,我仍然得到解析保存失败。 (我正在使用heroku) 我一直坚持了几天