Comments (20)
从标题来看,是这个类没有定义。你检查一下你的类(包括包名),如果仍然有问题,然后贴出点完整的 log
from pldroidmediastreaming.
java.lang.NoClassDefFoundError: com.pili.pldroid.streaming.camera.demo.CameraStreamingActivity
at com.example.rtmpdemo.MainActivity$1.onClick(MainActivity.java:35)
at android.view.View.performClick(View.java:4476)
at android.view.View$PerformClick.run(View.java:18795)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:177)
at android.app.ActivityThread.main(ActivityThread.java:5493)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041)
at dalvik.system.NativeStart.main(Native Method)
上面是Log,我跟了一下,根本的问题是StreamingBaseActivity这个类找不到,但我已经定义了,所以应该是用您的jar包或so库有问题
Ps:我是Eclipse开发,因此把您的demo进行了移植,不知是否移植问题?
from pldroidmediastreaming.
你好, StreamingBaseActivity 是 demo 里面定义的一个 Activity。
from pldroidmediastreaming.
from pldroidmediastreaming.
哦,那这个意思就只能在demo里用? 或者说您的jar包和.so文件是根据您的demo包名绑定的?如果是酱紫那我应该怎么使用?谢谢
from pldroidmediastreaming.
Demo 里的代码你可以根据你自己的需求更改。jar 包和 so 文档没有和 demo 包名绑定。
from pldroidmediastreaming.
那我根据您的demo里的代码修改之后就一直这个错
from pldroidmediastreaming.
可能是因为你的 Activity 是继承的 CameraStreamingActivity,但是你的 demo 里面没有 CameraStreamingActivity 。CameraStreamingActivity 在 sdk 和系统里,并不存在,是需要自己实现的。
from pldroidmediastreaming.
呵呵,肯定不是,那是那样我编译都过不了的,这个错跟jar包是有关系的。您要是方便的话,留个联系方式,交流交流
from pldroidmediastreaming.
你的 activity 是继承的什么?
from pldroidmediastreaming.
跟您的demo一致,即CameraStreamingActivity继承StreamingBaseActivity,其实我就是把您的demo里的代码粘贴过来,唯一的区别是这个demo是我新建的
from pldroidmediastreaming.
那你的 Manifest 里面,有注册么?
from pldroidmediastreaming.
有,要是没有我觉得就正常了
from pldroidmediastreaming.
你把 Manifest 里面的 StreamingBaseActivity 声明给去掉试试...
from pldroidmediastreaming.
另外,能否将 CameraStreamingActivity 所属的包名发来看看,总感觉是 CameraStreamingActivity 这个类有问题。修改之后,记得 clear 一下工程。
from pldroidmediastreaming.
我邮箱是[email protected],您给我发个邮件,然后我从邮箱里给你我的相关代码,帮我看看
from pldroidmediastreaming.
已发~请查收
from pldroidmediastreaming.
导入到 Android studio 里面报如下错误,这个是正常的报错,因为我发现你的 stream json string 并没有配置。所以,我不确定是不是 eclipse 哪个地方配置有问题...或者你是否尝试 clear/rebuild project? 不管怎么样,个人建议如果开发 android app,慢慢地转向 android studio,因为 google 都计划不支持 eclipse adt 了。可以确认的是提供的 sdk 应该是没有问题的。请知晓。
07-30 04:32:38.472 27158-27158/com.example.rtmpdemo D/AndroidRuntime﹕ Shutting down VM
07-30 04:32:38.473 27158-27158/com.example.rtmpdemo E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.rtmpdemo, PID: 27158
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.rtmpdemo/com.pili.pldroid.streaming.camera.demo.CameraStreamingActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2309)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.access$800(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference
at com.pili.pldroid.streaming.StreamingProfile$Stream.<init>(StreamingProfile.java:194)
at com.pili.pldroid.streaming.camera.demo.CameraStreamingActivity.onCreate(CameraStreamingActivity.java:42)
at android.app.Activity.performCreate(Activity.java:5979)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.access$800(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
from pldroidmediastreaming.
你也可以尝试重新依赖 jar 包,确认 jar 确实是正确依赖了的:
Java build path-> Libraries -> Add External JARS..
from pldroidmediastreaming.
好,非常感谢您这两天的回复
from pldroidmediastreaming.
Related Issues (20)
- Youtube rtmp link not working HOT 1
- 录屏推流需要使用CameraPreviewFrameView吗?
- 视频进度条 HOT 1
- Access denied finding property "camera.aux.packagelist"
- 推流端预览左右两边有黑色 HOT 1
- 如何推流前预览? HOT 1
- 开始推流后 返回状态码 streamingState = UNAUTHORIZED_STREAMING_URL extra = -3 HOT 1
- 快速开始是不是已经不能快速开始了? HOT 1
- targetSdkVersion 29录屏会闪退 HOT 1
- 编译报错,与我的项目中使用的库有冲突? HOT 2
- 通过captureFrame截帧,图像变形。
- 引用happy-dns,还报NoSuchMethodError错误 HOT 4
- No static method defaultResolver() HOT 3
- Issue with the support of 64 bit libraries.
- Unauthorized Package while starting the Streaming
- Pili Streaming not working with Pili Android Version 2.4.0
- activity添加两个fragment,使用懒加载,第二个fragment,无法调起相机 HOT 1
- 最新Demo运行不起来 HOT 3
- 急急急,请问为啥下载的apk demo是牛直播,github上下载的代码跑起来又不像同一个app
- 播放器拉流问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pldroidmediastreaming.