2017-07-12 4 views
1

enter image description here Hallo Leute, es tut mir leid, das ist eine nooby Frage. Aber ich kann das nicht herausfinden.Android-Server: Parse-Server Gradle Build

Mein PROBLEM: Ich versuche, einen Parse-Server in meinem Android-Studio-Projekt einzurichten, wurde mir gesagt, um es einzurichten Ich muss "compile 'compar.parse: parse-android: 1.14.1'into Abhängigkeiten hinzufügen und synchronisiere dein Gitter. " Aber wenn ich das mache, bekomme ich eine Reihe von Fehlern. Ich werde die Fehlerprotokolle auch teilen. Hier ist mein Code

/* 
 
* Copyright (c) 2015-present, Parse, LLC. 
 
* All rights reserved. 
 
* 
 
* This source code is licensed under the BSD-style license found in the 
 
* LICENSE file in the root directory of this source tree. An additional grant 
 
* of patent rights can be found in the PATENTS file in the same directory. 
 
*/ 
 
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.enableLocalDatastore(this); 
 

 
    // Add your initialization code here 
 
    Parse.initialize(new Parse.Configuration.Builder(getApplicationContext()) 
 
      .applicationId("") 
 
      .clientKey("") 
 
      .server("") 
 
      .build() 
 
    ); 
 

 
    ParseObject object = new ParseObject("ExampleObject"); 
 
    object.put("myNumber", "123"); 
 
    object.put("myString", "rob"); 
 

 
    object.saveInBackground(new SaveCallback() { 
 
     @Override 
 
     public void done(ParseException ex) { 
 
     if (ex == null) { 
 
      Log.i("Parse Result", "Successful!"); 
 
     } else { 
 
      Log.i("Parse Result", "Failed" + ex.toString()); 
 
     } 
 
     } 
 
    }); 
 

 

 
    ParseUser.enableAutomaticUser(); 
 

 
    ParseACL defaultACL = new ParseACL(); 
 
    defaultACL.setPublicReadAccess(true); 
 
    defaultACL.setPublicWriteAccess(true); 
 
    ParseACL.setDefaultACL(defaultACL, true); 
 

 
    } 
 
}
apply plugin: 'com.android.application' 
 

 
android { 
 
    compileSdkVersion 25 
 
    buildToolsVersion "25.0.2" 
 
    defaultConfig { 
 
     applicationId "com.karanvir.myapplication" 
 
     minSdkVersion 16 
 
     targetSdkVersion 25 
 
     versionCode 1 
 
     versionName "1.0" 
 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
 
    } 
 
    buildTypes { 
 
     release { 
 
      minifyEnabled false 
 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
 
     } 
 
    } 
 
} 
 

 
dependencies { 
 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
 
    compile 'com.parse:parse-android:1.15.7' 
 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
 
     exclude group: 'com.android.support', module: 'support-annotations' 
 
    }) 
 
    compile 'com.android.support:appcompat-v7:25.1.1' 
 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
 
    compile 'com.android.support:design:25.1.1' 
 
    testCompile 'junit:junit:4.12' 
 
}

+0

Sie müssen hinzufügen '‚com.parse: parse-android: 1.14.1' in die Abhängigkeiten widersprechen. Ich sehe nicht, dass Sie das getan haben – Rafa

+0

Bitte sehen Sie sich meine Screenshot –

+0

Ich habe die Antwort hier gesendet https://stackoverflow.com/questions/45070221/parse-server-android-studio-not-showing-information/ 45089318? Noredirect = 1 # comment77178426_45089318 –

Antwort

0
dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.parse:parse-android:1.15.7' 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.1.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:design:25.1.1' 
    //place it here just like this 
    compile 'com.parse:parse-android:1.14.1' 
    testCompile 'junit:junit:4.12' 
} 
+0

hat nicht funktioniert bro, schau auf meine screenshot ich aktualisierte es –

+0

installiere die annotation repository es schlägt vor. Klicken Sie einfach auf den Link, den es gibt – Rafa