问题描述
限时送ChatGPT账号..这是我上一个问题的延续:得到编译错误:包 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
commons-httpclient-3.1.jarcommons-logging.jargwt-twilio-1.1.jartwilio-java-sdk-3.3.14.jarorg.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屋!
更多推荐
[db:关键词]
发布评论