Android 无法启动活动组件信息

Android 无法启动活动组件信息,android,android-activity,Android,Android Activity,我看过很多关于它的话题,但问题仍然存在。我的应用程序非常简单,我只有一个名为PlayVideo的主要活动,它初始化MediaPlayer,从IPCAM流式传输视频。我已经替换了java构建路径中的lib文件。我还创建了一个新的AVD并清理了该项目 10-22 09:28:40.411: E/AndroidRuntime(1016): FATAL EXCEPTION: main 10-22 09:28:40.411: E/AndroidRuntime(1016): java.lang.Runtim

我看过很多关于它的话题,但问题仍然存在。我的应用程序非常简单,我只有一个名为PlayVideo的主要活动,它初始化MediaPlayer,从IPCAM流式传输视频。我已经替换了java构建路径中的lib文件。我还创建了一个新的AVD并清理了该项目

10-22 09:28:40.411: E/AndroidRuntime(1016): FATAL EXCEPTION: main
10-22 09:28:40.411: E/AndroidRuntime(1016): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.c2s.playerfirst/com.c2s.player.PlayVideo}: java.lang.ClassNotFoundException: Didn't find class "com.c2s.player.PlayVideo" on path: DexPathList[[zip file "/data/app/com.c2s.playerfirst-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.c2s.playerfirst-1, /system/lib]]
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.os.Looper.loop(Looper.java:137)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.app.ActivityThread.main(ActivityThread.java:5103)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at java.lang.reflect.Method.invokeNative(Native Method)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at java.lang.reflect.Method.invoke(Method.java:525)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at dalvik.system.NativeStart.main(Native Method)
10-22 09:28:40.411: E/AndroidRuntime(1016): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.c2s.player.PlayVideo" on path: DexPathList[[zip file "/data/app/com.c2s.playerfirst-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.c2s.playerfirst-1, /system/lib]]
10-22 09:28:40.411: E/AndroidRuntime(1016):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
10-22 09:28:40.411: E/AndroidRuntime(1016):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
10-22 09:28:40.411: E/AndroidRuntime(1016):     ... 11 more
10-22 10:05:56.052: E/AndroidRuntime(1039): FATAL EXCEPTION: main
10-22 10:05:56.052: E/AndroidRuntime(1039): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.c2s.playerfirst/com.c2s.player.PlayVideo}: java.lang.ClassNotFoundException: Didn't find class "com.c2s.player.PlayVideo" on path: DexPathList[[zip file "/data/app/com.c2s.playerfirst-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.c2s.playerfirst-1, /system/lib]]
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.os.Looper.loop(Looper.java:137)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.app.ActivityThread.main(ActivityThread.java:5103)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at java.lang.reflect.Method.invokeNative(Native Method)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at java.lang.reflect.Method.invoke(Method.java:525)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at dalvik.system.NativeStart.main(Native Method)
10-22 10:05:56.052: E/AndroidRuntime(1039): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.c2s.player.PlayVideo" on path: DexPathList[[zip file "/data/app/com.c2s.playerfirst-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.c2s.playerfirst-1, /system/lib]]
10-22 10:05:56.052: E/AndroidRuntime(1039):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
10-22 10:05:56.052: E/AndroidRuntime(1039):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
10-22 10:05:56.052: E/AndroidRuntime(1039):     ... 11 more
舱单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.c2s.playerfirst"
    android:versionCode="1"
    android:versionName="1.0" >


    <uses-sdk
        android:minSdkVersion="12"
        android:targetSdkVersion="18" />

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity

            android:name="com.c2s.player.PlayVideo"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

尝试删除bin和gen目录,清理项目,并确保在生成路径、订单和导出选项卡下检查所有库,如果您在应用程序中使用它们。

确保您的类已启动。。同时发布一些代码以便于清楚理解。。我已使用我的活动类编辑;)从清单文件中,您的包名为package=“com.c2s.playerfirst”,但在活动声明中,它显示的是android:name=“com.c2s.player.PlayVideo”。我将名称更改为com.c2s.playerfirst。现在我一无所有!表示您的活动已开始。现在问题在于您的视频播放部分。谢谢,我尝试过这个,但仍然是一样的。顺序和导出顺序如下:Android、Android私有库、Android依赖项、myproject/src、myproject/gen
public class PlayVideo extends Activity{

//private String  videoPath="http://192.168.0.157";
private String videoPath="http://50.73.56.89";

private static ProgressDialog progressDialog;
String videourl;
VideoView videoView;

@Override
protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_play_video);
    progressDialog = ProgressDialog.show(PlayVideo.this, "", "Buffering Video");
    progressDialog.setCancelable(true);

    PlayVideo();
}


private void PlayVideo(){
    try{
        getWindow().setFormat(PixelFormat.TRANSLUCENT);

        videoView = (VideoView)findViewById(R.id.VideoView);

        MediaController mediaController = new MediaController(PlayVideo.this);
        mediaController.setAnchorView(videoView);

        Uri video = Uri.parse(videoPath);
        System.out.println(video);
        videoView.setMediaController(mediaController);
        videoView.setVideoURI(video);
        videoView.requestFocus();

        videoView.setOnPreparedListener(new OnPreparedListener() {

            @Override
            public void onPrepared(MediaPlayer mp) {
                System.out.println("********  BEGIN ONPREPARED ********");
                progressDialog.dismiss();
                videoView.start();
                System.out.println("******** END ONPREPARED ********");
            }
        });

    }catch(Exception e){
        progressDialog.dismiss();
        System.out.println("Video Play Error : "+e.toString());
        finish();
    }
}

}