Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRicky Sparks
22,249 PointsAndroid app has error: Execution failed task':app:preDexDebug' trying to test parse but can't run app with this error
Screenshot below
2 Answers
Ryan Farber
5,329 PointsYou are a gold mine for errors!
Try this : File ----> Invalidate caches/restart
let me know if it still happens
Ricky Sparks
22,249 PointsThe same error still exists?
Ryan Farber
5,329 PointsTry
Build -> Rebuild Project
Build -> Clean project
If not, try re-syncing your files for the application and gradle. It's definitely not your code doing this, it has to do with the files in Android Studios
Ricky Sparks
22,249 Pointsit has two errors now? the jar file is empty is new?
Ryan Farber
5,329 PointsFrom what I read, it has to do with Parse and your Java. You might need to upgrade your Java, then definitely re-install your parse file. Then try to re-sync
http://stackoverflow.com/questions/23847482/error-gradle-execution-failed-for-task-apppredexdebug
Ricky Sparks
22,249 PointsIs it possible that I don't even have java installed? Because my command prompt showed no java when I typed javac in it
Ryan Farber
5,329 PointsIt could be any number of possible reasons.
Search up 'Java jdk' and download it or go to the site below
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Ricky Sparks
22,249 PointsI installed java, added a new parse file and re-synced ribbit app directory. But still the one error? Good news is I deleted the vulnerable java 7 and installed java 8.
Ryan Farber
5,329 PointsLink your dependencies. It might be because it's calling the file twice?
http://stackoverflow.com/questions/21102598/android-studio-unexpected-top-level-exception
Ricky Sparks
22,249 PointsTook awhile for me to have parse recognize but found out i needed to add as library to all the parse files in libs. I still have the one error though?
Ryan Farber
5,329 PointsCan you also add your other build file to double check something?
Meanwhile, change out the bottom two dependencies to
compile 'com.android.support:support-v4:13.0.+'
Ryan Farber
5,329 PointsSwitch from project view to Android view to make it easier. It's right above the Ribbit app name
build.gradle(ribbit)
build.gradle(app)
Ryan Farber
5,329 PointsLet's try this.
delete both support files from your library
Change your dependencies to the following:
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v13:21.0.0'
compile 'com.parse.bolts:bolts-android:1.1.2'
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
I think the library v4 and v13 are conflicting with each other if my theory is correct.
Resync, clean, etc.
Ryan Farber
5,329 PointsGo to your Android SDK and download the extras
Ricky Sparks
22,249 PointsAwesome I was able to run my app in the emulator with no errors :D What you did got rid of that error :D
Now when I added the test object from parse I got this now?
Ryan Farber
5,329 PointsParse imports may be off
import com.parse.ParseAnalytics;
import com.parse.ParseUser;
Ricky Sparks
22,249 PointsI use the suggested fix for the errors and they all made this code in the ParseObject.java is that ok?
Ryan Farber
5,329 PointsYou end up deleting that particular code anyways in the next few videos. Just delete those lines you just made and the previous one and you should be fine
Ricky Sparks
22,249 PointsOk thanks for all your help it seems all the errors are gone :D
Ricky Sparks
22,249 PointsRicky Sparks
22,249 Pointshttp://i.imgur.com/fYwQFZC.png?1