包 com.twilio.sdk 的 java.lang.ClassNotFoundException [英] java.lang.ClassNotFoundException for package com.twilio.sdk

查看:28
本文介绍了包 com.twilio.sdk 的 java.lang.ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我上一个问题的延续:得到编译错误:包 com.twilio.sdk 不存在

This is in continuation to my previous question: Getting compile error: package com.twilio.sdk does not exist

我必须解决编译错误,现在尝试在 Android 设备上运行 uiautomator 测试.但是,我收到 java.lang.ClassNotFoundException,因为 android 设备没有 Twilio API jars/classes.

I got to resolve the complie error and now trying to run the uiautomator test on an android device. However, I am getting java.lang.ClassNotFoundException as the android device would not have Twilio API jars/classes.

因此,我搜索了可以使用 Twilio API jar 或其中的类构建最终 jar 的解决方案.我遇到了 'jar-jar' 和 'one-jar' 方法,但没有奏效.我可能在这里做错了什么.如果有人可以提供如何使用这些方法中的任何一种的示例,我将不胜感激.

So, I searched for solutions where I could build my final jar with Twilio API jar or the classes within that. I came across 'jar-jar' and 'one-jar' approaches to do so but did not work. I may be doing something wrong here. I'd really appreciate if someone could give a sample how to use any of these approaches.

我还发现一些其他建议可以通过build.xml"来完成,例如将以下行添加到-jar"任务中:

I also found couple of other suggestions to do it via 'build.xml' such as adding the following line to the '-jar' task:

<zipgroupfileset dir="${jar.libs.dir}" includes="*.jar"/>

上述方法确实将 Twilio 类包含到我的最终 jar 中(我的最终 jar 大小因 Twilio jar 的大小而增加),但是,我的最终 jar 无法保留其中 Twilio 类的目录结构.我的最终 jar 将所有类都放在根目录下,所有文件夹都是空白的.

The above approached did include the Twilio classes to my final jar (my final jar size got increased by the size of the Twilio jar), however, my final jar could not persist the directory strucure for the Twilio classes within it. My final jar had all the classes at the root directory and all the folders were blank.

因此,我不知道有更多方法可以解决此问题.如果你们中有人有任何建议/想法,请分享.

So, I am not aware of any more approaches to resolve this. If anyone of you have any suggestions/idea, please share.

问候,

坚持

推荐答案

需要以下 jar 文件才能正确运行 twilio

Following jar files are required to run twilio properly

  1. commons-httpclient-3.1.jar
  2. commons-logging.jar
  3. gwt-twilio-1.1.jar
  4. twilio-java-sdk-3.3.14.jar
  5. org.apache.httpcomponents.httpclient_4.3.1.jar

您没有提供完整的堆栈跟踪.我在 twilio 中做了几个项目,我使用了上面的 jar 文件,否则会发生 classnotfound 错误

You have not provided the full stacktrace.I have done few projects in twilio and I use the above jar files otherwise classnotfound error occurs

这篇关于包 com.twilio.sdk 的 java.lang.ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆