Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
88 views
in Technique[技术] by (71.8m points)

How To Add Parse to an Android Studio Project?

I'm trying to use the Parse library in Android Studio. I have used the basic example on their website and added the jar to the libs folder as well as added as a global library. Nothing seems to be working without errors:

Gradle: package com.parse does not exist
Gradle: package com.parse does not exist
Gradle: package com.parse does not exist
Gradle: cannot find symbol variable Parse
Gradle: cannot find symbol variable ParseAnalytics
Gradle: cannot find symbol class ParseObject 
Gradle: cannot find symbol class ParseObject

Android Studio gives no errors in the code.

question from:https://stackoverflow.com/questions/16614177/how-to-add-parse-to-an-android-studio-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I encountered the same problem too and here's what I did:

  • I placed the entire Parse-1.2.5 in the libs folder (I didn't have to create the folder as Parse's quickstart said).
  • Open the build.grade file. There are two of them - open the one that's at the same level as the src folder
  • You'll see two instances of "dependencies". Add the following to the "dependencies" that is NOT nested under "buildscript":

    compile files('libs/Parse-1.2.5/Parse-1.2.5.jar')

If that still doesn't work, try right clicking the Parse-1.2.5.jar file and select "Add to Project Library"

Hope that helps!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...