Android解析设置

问题描述 投票:0回答:1

我正在尝试建立我的第一个解析项目,但是进展并不顺利。我认为应该是非常简单的,但是即时通讯仍然有问题,而且YouTube上目前没有教程可以找到我的作品。我发现它的最新教程已经3年了。

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

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

我已经尝试了2种方法。

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>
android android-studio gradle parse-platform android-parser
1个回答
0
投票

我在解析README.MD时遇到了相同的错误

您需要删除当前项目并开始一个新项目并按照以下指南进行操作。

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

© www.soinside.com 2019 - 2024. All rights reserved.