org.jose4j.json.internal.json_simple找不到。

huangapple go评论77阅读模式
英文:

org.jose4j.json.internal.json_simple can not be found

问题

我已经在IntelliJ中创建了一个Android项目并添加了一个外部的JAR文件。
我已经安装了"json-simple-1.1.jar"以使用包org.jose4j.json.internal.json_simple。我进行了库设置,以便从项目结构菜单中使用它。
但是当我运行程序时,错误消息显示:
"错误:包org.jose4j.json.internal.json_simple不存在
import org.jose4j.json.internal.json_simple.JSONArray;"。
(不仅是JSONArray,还有其他JSON,比如JSONObject)

在Android项目之外使用时,它是有效的。
是否有Android项目的特殊设置?

到目前为止,我通过创建"lib"文件夹,并将jar文件存储在项目文件夹下。

英文:

I have created an Android project and added an external JAR on IntelliJ.
I have already installed "json-simple-1.1.jar" to use package org.jose4j.json.internal.json_simple. I did a library setting to use that from the project structure menu.
But when I run the program, error message says,
"error: package org.jose4j.json.internal.json_simple does not exist
import org.jose4j.json.internal.json_simple.JSONArray;".
(Not only JSONArray, but the other JSON such as JSONObject)

It worked when I used that outside of the Android project.
Are there any special settings for the Android project?

So far, I stored the jar file under the project folder by making "lib" folder additionally.

答案1

得分: 0

app/build.gradledependencies 部分中添加以下内容:

compile group: 'org.bitbucket.b_c', name: 'jose4j', version: '0.7.0'

在 IntelliJ IDEA 中重新导入/刷新项目。

英文:

In app/build.gradle dependencies section add the following:

compile group: 'org.bitbucket.b_c', name: 'jose4j', version: '0.7.0'

Reimport/refresh the project in IntelliJ IDEA.

huangapple
  • 本文由 发表于 2020年3月15日 09:27:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/60688907.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定