Jordan Daly
Jordan Daly

Reputation: 64

java.lang.NoSuchMethodError: com.parse.ParseObject.getClassName

java.lang.NoSuchMethodError: com.parse.ParseObject.getClassName
at com.parse.ParseQueryAdapter.<init>(ParseQueryAdapter.java:179)

After migrating from parse platform to parse open server on heroku I updated the dependency to newer parse SDK to allow server url in parse initialization, app/build.gradle now has

compile 'com.parse.bolts:bolts-android:1.4.0'
    compile 'com.parse:parse-android:1.13.0'

i tried manually compiling the parse libraries from the jar compile files('libs/Parse-1.13.0.jar') but this results in error

Process 'command 'C:\Program Files\Java\jdk1.7.0_71\bin\java.exe' finished with non-zero exit value 2

and even tried setting multiDexEnabled true but this results in another error

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: com/parse/AbstractQueryController$1.class 

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
defaultConfig {
    applicationId "com.example.app"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"

    // Enabling multidex support.
    //multiDexEnabled true


}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        debuggable true
    }
}

repositories {
    mavenCentral()
}

}

dependencies {

testCompile 'junit:junit:4.12'

compile 'com.parse.bolts:bolts-android:1.4.0'
compile 'com.parse:parse-android:1.13.0'

compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
compile 'com.parse:parseui-widget-android:0.0.1'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.parse:parsefacebookutils-v4-android:1.10.3@aar'

}

Upvotes: 0

Views: 131

Answers (1)

Jordan Daly
Jordan Daly

Reputation: 64

got past this issue by changing

mainAdapter = new ParseQueryAdapter<ParseObject>(this, Todo.class);

to

mainAdapter = new ParseQueryAdapter<ParseObject>(this, "Todo");

error was pointing to ParseUI-Widget/src/main/java/com/parse/ParseQueryAdapter.java

public ParseQueryAdapter(Context context, Class<? extends ParseObject> clazz) {
this(context, ParseObject.getClassName(clazz));

}

at getClassName it said Non-Static method cannot be referenced from a static context

Upvotes: 1

Related Questions