Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
The issue I have is that I have an existing project that depends on Parse. My question is how do I integrate Adobe CreativeSDKImage because it extends MultiDexApplication whereas Parse Application (Class) extends Application.

Existing Project e.g (MyApp extends Application ) import android.app.Application;

CreativeSDK based on ADOBE CREATIVE SDK IMAGE GUIDE e.g (CreativeSDKImageSampleApp extends) import android.support.multidex.MultiDexApplication;

After hours of trying to figure out why my app now crashes everytime it starts-up, I noticed Parse.initilize is the issue or perhaps correct me if I'm wrong, as I also suspect extends MultiDexApplication might be the cause. I read limitations of using MultiDexApplication here for your reference; BUILDING MULTIDEX

So please look at the code below to help me in the integration of Parse with CreativeSDKImage Application.

Java
package com.aviary.android.sample; 
 
import android.support.multidex.MultiDexApplication; 
import com.aviary.android.feather.sdk.IAviaryClientCredentials; 
import com.parse.Parse; 
import com.parse.ParseACL; 
import com.parse.ParseUser; 
 
public class MyApplication extends MultiDexApplication implements IAviaryClientCredentials { 
    @Override 
    public void onCreate() { 
        super.onCreate(); 
        init(); 
    } 
 
    private void init() { 
        // Enable Local Datastore. 
        Parse.enableLocalDatastore(getApplicationContext()); 
 
        // Add your initialization code here 
        Parse.initialize(this);
 
        ParseUser.enableAutomaticUser(); 
        ParseACL defaultACL = new ParseACL();
        // Optionally enable public read access. 
        // defaultACL.setPublicReadAccess(true); 
        ParseACL.setDefaultACL(defaultACL, true);
    } 
 
    @Override 
    public String getBillingKey() {
        return ""; 
    } 
 
    @Override 
    public String getClientID() {
        return "YOUR CLIENT ID"; 
    } 
 
    @Override 
    public String getClientSecret() {
        return "YOUR CLIENT SECRET"; 
    } 
} 


I am getting this error when I run the code;

Java
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime: FATAL EXCEPTION: main
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime: Process: com.aviary.android.sample, PID: 3700
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime: java.lang.NoSuchMethodError: No virtual method setFollowRedirects(Z)V in class Lcom/squareup/okhttp/OkHttpClient; or its super classes (declaration of 'com.squareup.okhttp.OkHttpClient' appears in /data/app/com.aviary.android.sample-1/base.apk)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.parse.ParseOkHttpClient.<init>(ParseOkHttpClient.java:58)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.parse.ParseHttpClient.createClient(ParseHttpClient.java:45)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.parse.ParsePlugins$Android.newHttpClient(ParsePlugins.java:175)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.parse.ParsePlugins.restClient(ParsePlugins.java:91)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.parse.Parse.initialize(Parse.java:196)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.parse.Parse.initialize(Parse.java:161)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.aviary.android.sample.MyApplication.init(MyApplication.java:22)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.aviary.android.sample.MyApplication.onCreate(MyApplication.java:14)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at android.app.ActivityThread.-wrap1(ActivityThread.java)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-29 16:09:56.741 3700-3700/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-29 16:0
Posted
Comments
Richard MacCutchan 30-Oct-15 6:09am    
The error message is clearly telling you what is missing from the application.
Member 11361504 1-Nov-15 15:36pm    
Do you think you have an idea of what that could be?
Richard MacCutchan 2-Nov-15 4:01am    
Read the messages. they are clearly telling you that some method that you are trying to call does not exist inside your application. You need to check the documentation for that class and method.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900