【问题标题】:Android Parse SetupAndroid 解析设置
【发布时间】:2019-02-04 16:15:59
【问题描述】:

我正在尝试设置我的第一个解析项目,但进展并不顺利。我认为这应该非常简单,但是我仍然遇到问题,并且 youtube 上没有我可以找到该工作的当前教程。我为它找到的最新教程已有 3 年历史了。

我正在尝试按照此处的说明进行操作:

https://docs.parseplatform.org/android/guide/#installation

我已经尝试了两种方法。

1)我在这里从github下载了解析项目:

https://github.com/parse-community/Parse-SDK-Android

下载这个项目会带来很多额外的东西,比如 fcm、gcm 和 ktx 的文件夹。然而,parse 文件夹也带有大量的类。

我一直在关注教程,这些教程给了我一个已经设置好的模板解析项目,但是我相信这对于 android studio 2.2 来说很重要(我目前正在运行 3.3)当我尝试升级文件时,它会给我大量的兼容性错误。

如果有人对如何解决此问题有任何建议,我将不胜感激。这是我在下面尝试过的:

我已按照上面链接中的说明进行操作,但出现此错误:

    Could not find method implementation() for 
arguments [com.github.parse-community.Parse-SDK-Android:parse:1.18.5] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

我不明白的是说明要求我这样做。

2) 我尝试的第二种方法是我在 android 中创建了一个新项目,但我仍然在该行遇到相同的错误。

这是我尝试过的方式的 gradle 文件:

1号路)

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        implementation "com.github.parse-community.Parse-SDK-Android:parse:1.18.5"
    }
}

plugins {
    id 'com.github.ben-manes.versions' version '0.20.0'
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

ext {
    compileSdkVersion = 27

    supportLibVersion = '27.1.1'

    firebaseJobdispatcherVersion = '0.8.5'

    minSdkVersion = 14
    targetSdkVersion = 27
}

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.parse">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />


    <application

    android:name="App"></application>


    <application />

</manifest>

2号路)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        implementation "com.github.parse-community.Parse-SDK-Android:parse:1.18.5"

    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }


    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.parsetemplate">

    <application

        android:name="App"

        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

【问题讨论】:

  • 我使用 parse 的时间最长,然后转到了 firebase。 firebase 要好得多。从那里开始。我只为用户使用firebase。其他一切都是通过php。

标签: android android-studio gradle parse-platform android-parser


【解决方案1】:

我在执行 parse README.MD 时遇到了同样的错误

您只需要删除当前项目并开始一个新项目,然后按照以下指南操作即可。

https://www.back4app.com/docs/android/parse-android-sdk

【讨论】:

    【解决方案2】:

    您需要从build.gradle(Project: your_project_name) 复制位于 allprojects 块内的完整存储库块,并将其粘贴到 build.gradle(Module: app) 文件的末尾。

    完成后,您应该重新构建一次项目。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-04
      • 1970-01-01
      相关资源
      最近更新 更多