I am stuck in a very stupid type of problem from 3 days and still have no luck. I use Parse.com to register and login. I also use twitter and facebook. My oncreate application method: -
public void onCreate() {
super.onCreate();
Parse.initialize(this, AppConstants.PARSE_APP_ID, AppConstants.PARSE_CLIENT_KEY);
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
FacebookSdk.sdkInitialize(getApplicationContext());
}
}
My gradle build: -
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "rsi.com.componentsdemo"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "2048M"
jumboMode = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}}dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'org.apache.httpcomponents:httpmime:4.3'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.facebook.android:facebook-android-sdk:4.2.0'
compile('org.twitter4j:twitter4j-core:4.0.1') {
exclude group: 'com.google.android', module: 'support-v7'
}
compile project(':lib')
compile files('libs/Parse-1.11.0.jar')
}
I am using parse 1.11.0.jar lib in the libs folder.
Now the fact is that the same code works on an Android 5.0.1 device, but it crashes in version 4.1.1.
LogCat is as follows: -
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.parse.ParsePlugins$Android
at com.parse.Parse.initialize(Parse.java:191)
at rsi.com.componentsdemo.ComponentsDemoAppClass.onCreate(ComponentsDemoAppClass.java:20)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151)
at android.app.ActivityThread.access$1300(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Please help me deal with this issue. Thanks!!
source
share