如何将解析添加到 Android Studio 项目? [英] How To Add Parse to an Android Studio Project?
问题描述
我正在尝试在 Android Studio 中使用 Parse 库.我在他们的网站上使用了基本示例,并将 jar 添加到 libs 文件夹以及添加为全局库.似乎没有任何错误可以正常工作:
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 在代码中没有给出任何错误.
Android Studio gives no errors in the code.
推荐答案
我也遇到了同样的问题,我是这样做的:
I encountered the same problem too and here's what I did:
- 我将整个 Parse-1.2.5 放在 libs 文件夹中(我不必像 Parse 的快速入门所说的那样创建文件夹).
- 打开 build.grade 文件.其中有两个 - 打开与 src 文件夹处于同一级别的那个
您将看到两个依赖项"实例.将以下内容添加到未嵌套在buildscript"下的dependencies":
- 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":
编译文件('libs/Parse-1.2.5/Parse-1.2.5.jar')
compile files('libs/Parse-1.2.5/Parse-1.2.5.jar')
如果仍然不起作用,请尝试右键单击 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"
希望有帮助!
这篇关于如何将解析添加到 Android Studio 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!