有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java安卓服务器:解析服务器gradle构建

enter image description here嘿,伙计们,很抱歉,这是一个不着边际的问题。但是我想不出来

我的问题:我试图在我的安卓 studio项目中设置解析服务器,有人告诉我要设置它,我需要“尝试将compile'com.parse:parse 安卓:1.14.1'添加到依赖项中,并同步您的网格。”然而,当我这样做的时候,我会犯很多错误。我还将分享错误日志。这是我的密码

/* * 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 安卓.app.Application; import 安卓.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.安卓.application'

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

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

共 (1) 个答案

  1. # 1 楼答案

    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'
    }