Error:execution Failed For Task ':app:dexdebug'. Parse.com
Solution 1:
Remove the below line from your gradle file
compilefileTree(dir: 'libs', include: ['*.jar'])
because you already have it here
compile'com.parse.bolts:bolts-android:1.+'compile'com.parse:parse-android:1.+'
These lines as to be in a class extending Application
Parse.enableLocalDatastore(this);
Parse.initialize(this, "8R4nAHgdPDJ*****E2Hj0y4pSlO9sA1b", "qJomEl0uICAsg7uwiDvxEtW****3S01N8a3XNr");
And you shouldn't post these code, it's meant to be kept secret.
For example here:
package <your.package.name>;
import android.app.Application;
import com.parse.Parse;
import com.parse.ParseInstallation;
publicclassClassNameApplicationextendsApplication {
@OverridepublicvoidonCreate() {
super.onCreate();
Parse.initialize(this, "2zMz0hbE****r4sMwZJrYtX", "YdK7lFBh5MI6gca*****WPXmKb");
ParseInstallation.getCurrentInstallation().saveInBackground();
}
}
And add this class name in your manifest file:
here:
<application
android:name=".ClassNameApplication "
android:allowBackup="true"
......
Solution 2:
Just add this
android {...
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}
..}
and add multiDexEnabled true
in defaultConfig
tag
This is my Application Class public class Example extends MultiDexApplication {
in manifest add like this <application
android:name=".Example"
and this is my gradle file
defaultConfig {
applicationId "com.example"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true// add this
}
Solution 3:
You need to implement Multidex
Also you have some structure problems. The following lines should be called only once. So you need to create a class application and register it in manifest then call your lines onCreate in that application class.. Here is the example..
Parse.enableLocalDatastore(this);
Parse.initialize(this, "YOUR_KEY");
Good luck there.
Post a Comment for "Error:execution Failed For Task ':app:dexdebug'. Parse.com"