Cflux
Cflux

Reputation: 1532

Android Parse Setup

I am trying to set up my first parse project however its not going so well. I would think it should be very straight forward however im still having issues and there are no current tutorials on youtube that i can find that work. The latest tutorial i've found for it is 3 years old.

I'm trying to follow the instructions here:

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

I've tried it 2 ways.

1) I have downloaded the parse project from github here:

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

Downloading this project comes with a lot of extras for this that are currently way over my head like folders for fcm, gcm, and ktx. The parse folder however also comes with a ton of classes.

I've been following tutorials which gave me a template parse project that was already set up however it was mean for android studio 2.2 i believe (Im currently running 3.3) When i would try to upgrade the files, it would give me tons of compatibility errors.

if anyone has any suggestions on how to fix this, i would greatly appreciate it. Here is what I have tried below:

i've followed the instructions in the link above however i get this error:

    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.

What i dont understand is that the instructions asked me to do this.

2) the second way i've tried it is that i've created a new project in android and i still get the same error at that line.

here is my gradle file for the ways i've tried it:

way number 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>

way number 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>

Upvotes: 0

Views: 484

Answers (2)

K P Ramanath
K P Ramanath

Reputation: 1

You need to copy the complete repositories block, which is inside allprojects block from the build.gradle(Project: your_project_name), and paste it at the end of the build.gradle(Module: app) file.

After you have done that you should rebuild your project once.

Upvotes: 0

BlankSpace
BlankSpace

Reputation: 681

I was getting the same error when I followed parse README.MD

All you need to delete your current project and start a new one and follow the below guide.

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

Upvotes: 0

Related Questions