- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试在 android 上实现 JAIN sip 堆栈,但是当我尝试编译演示程序时出现此错误:
trouble processing "javax/sip/ClientTransaction.class":
Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.
This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.
However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.
If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.
If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.
[2012-11-11 22:27:28 - Jain-Test-and] Dx 1 error; aborting
[2012-11-11 22:27:28 - Jain-Test-and] Conversion to Dalvik format failed with error 1
是否可以在 eclipse 中向编译器添加 --core-library 参数,如果可以,我该怎么做,我可以向程序添加命令行选项,但不知道该怎么做它给编译器。另外,是否建议这样做,或者是否有其他解决方法?
最佳答案
JAIN jar 正在为其包使用 javax
命名空间。 Android 不允许在外部 jar 中使用核心库。所以你必须重新包装它们。您可以将此与 Ant 结合使用和 JarJar (如错误输出中所述)通过完成以下步骤:
在 build.xml 中添加此代码以重新打包 JAIN jar:
<target name="-jarjar" depends="compile">
<taskdef
name="jarjar"
classname="com.tonicsystems.jarjar.JarJarTask"
classpath="buildtools/jarjar-1.4.jar"/>
<jarjar jarfile="${out.absolute.dir}/jain-sip-sdp-repackaged.jar">
<fileset dir="${out.classes.absolute.dir}" />
<zipfileset src="libs/jain-sip-sdp-1.2.2014.jar" />
<rule pattern="javax.**" result="com.demo.@1"/>
<rule pattern="gov.nist.javax.**" result="com.demo.@1"/>
</jarjar>
<jarjar jarfile="${out.absolute.dir}/jain-sip-api-repackaged.jar">
<fileset dir="${out.classes.absolute.dir}" />
<zipfileset src="libs/jain-sip-api-1.2.jar" />
<rule pattern="javax.**" result="com.demo.@1"/>
</jarjar>
<jarjar jarfile="${out.absolute.dir}/jain-sip-ri-repackaged.jar">
<fileset dir="${out.classes.absolute.dir}" />
<zipfileset src="libs/jain-sip-ri-1.2.2014.jar" />
<rule pattern="gov.nist.javax.**" result="com.demo.@1"/>
</jarjar>
</target>
在命令行工具中调用 ant install
。将新 jar 添加到您的构建路径并删除旧 jar 。
关于android - android 上的 Jain SIP 堆栈提示核心类的错误使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13335248/
让我先描述一下我的问题。我将 Sofia SIP 用于电话应用程序,而我使用的 SIP 代理位于 NAT 后面。这意味着来自代理的传入邀请将内部代理 IP(例如 10.0.0.1)作为 Contact
我试图找出 的可能值范围接受 和 接受-联系 header 字段,但我在 RFC 中找不到完整列表。有谁知道他们在哪里?我经常看到 Accept: application/sdp;level=1,
我使用的 SIP 服务器通过端口 5070 监听 SIP/TLS 请求。我正在尝试跟踪和分析为什么我的拨号器没有通过 Wireshark 在网络上注册。 我已经在 Wireshark 的首选项中编辑了
我一直非常坚持解决这个问题,我去过几乎所有谈论这个主题的网站(包括旧的堆栈溢出帖子),现在我正在尝试遵循 Android“官方”文档以便让我的 SIP 客户端在我的 Asterisk 服务器上注册,应
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我已经从一个 Asterisk(版本 11.2.1)创建了一个 sip 中继,说“A”服务器到另一个 Asterisk 服务器(11.7.0)说“B”,我得到 sip 响应 200 ok。 但是当我开
我几乎设法发起了一个 2 方通话(点击通话):第一个到我的办公室,第二个到我的手机,使用 Michal Niklas 回答(感谢 Michal) Asterisk click to call . 主要
本地和远程标记以及Call-ID的组合用于识别对话。据说Call-ID是一次调用的唯一值。那么为什么 Call-ID 不单独用于识别对话呢? 最佳答案 一句话:“发夹”。 “Hairpinning”是
我想在SIPBYE报头中获取Custom-Order的值。我尝试使用${sip_yee_h_Custom-Order},但它是空的,因为头名称前没有X前缀。。我可以编辑freeswitch sofia
我在使用以下代码时遇到错误。 我已经包含了 Sip 所需的所有 jar ;但是,我仍然不明白为什么会发生这个错误。你能给我解释一下吗? 我的代码类是: import java.net.InetAddr
我有一个 res_mysql.conf 配置为使用从 db.sql 文件重新填充的一些数据库 db。加载转储后,我重新加载配置,我的 SIP 对等点消失了: dev-ast*CLI> sip show
我正在制作 SIP 电话并且必须开发一个功能来支持多个注册。如果手机的主注册服务器关闭,手机应自动注册到辅助注册器,并在主注册器处于事件状态时再次返回主注册器。我的问题是:如何确定主注册商再次活跃起来
我正在尝试实现一个 sip 服务器以连接到 HTML sip 客户端(使用 sipml5 制作)。在我研究这样做的过程中,我遇到了 sip over web-sockets,这可能对我有用,但是,我不
我需要通过 Lua 脚本在 Kamailio 3.3.1 中设置自定义 header 。理论上我可以像这样在配置脚本中设置一个 - append_hf("X-MyHeader: myvalue\r\n
我需要通过 Lua 脚本在 Kamailio 3.3.1 中设置自定义 header 。理论上我可以像这样在配置脚本中设置一个 - append_hf("X-MyHeader: myvalue\r\n
DTMF 用于一些基于 sip 的软电话来处理负载类型。但是我不清楚使用 DTMF 的过程和重要性。开源软件电话,如 Red5phone和 Sipdroid使用 DTMF。任何人都可以解释这个问题或指
我需要一种在使用 Asterisk 调用文件发起调用时添加 SIP header 的方法。 有什么办法可以在通话文件中添加SIP头吗? 我知道我可以使用 Asterisk AGI 完成此操作,但是我找
我目前在连接到我的 SIP 客户端(IVR 语音服务)的对称 NAT 后面存在 SIP 用户代理问题。 我读到 Asterisk 在 sip.conf 中有一个解决方案,我可以在那里设置属性 nat=
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 已关闭11 年前。 Improve th
我的客户公司有一个简单的 Web 应用程序 (Python Flask),我需要向它添加电话通知功能。 主要要求是应用程序应该调用用户、播放某个声音文件并接受一些音调输入(“您好!这是来自您的 Web
我是一名优秀的程序员,十分优秀!