My Code :
package com.example.rtmp04;
import android.os.Bundle;
import android.util.Log;
import com.unity3d.player.UnityPlayerActivity;
public class UnityRtmp extends UnityPlayerActivity {
public static final String LOGTAG = "UnityRtmp";
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d(UnityRtmp.LOGTAG, "onCreate 1");
super.onCreate(savedInstanceState);
Log.d(UnityRtmp.LOGTAG, "onCreate 2");
setContentView(R.layout.main);
Log.d(UnityRtmp.LOGTAG, "onCreate 3");
}
}
Res/layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
AndroidManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rtmp04"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:label="@string/app_name">
<activity android:name=".UnityRtmp"
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>
Why Crash ?
Can you attach the exception stack trace ?
bitter
3
what is it you are trying to do?
setContentView(R.layout.main); <<-- this will replace the unity rendering surface
I try to use RTSP streaming video in Android.
VideoView elements, support RTSP in Android.
Because I have found that they can not resolve the RTSP stream in unified C # (Android or IOS).
use any R.xxx crash.
04-29 17:17:00.214: E/AndroidRuntime(7191): FATAL EXCEPTION: main
04-29 17:17:00.214: E/AndroidRuntime(7191): Process: com.example.rtmp02, PID: 7191
04-29 17:17:00.214: E/AndroidRuntime(7191): java.lang.Error: FATAL EXCEPTION [main]
04-29 17:17:00.214: E/AndroidRuntime(7191): Unity version : 4.5.5f1
04-29 17:17:00.214: E/AndroidRuntime(7191): Device model : Sony C6902
04-29 17:17:00.214: E/AndroidRuntime(7191): Device fingerprint: Sony/C6902/C6902:4.4.4/14.4.A.0.157/Yv__jQ:user/release-keys
04-29 17:17:00.214: E/AndroidRuntime(7191): Caused by: java.lang.NoClassDefFoundError: com.example.rtmp02.R$layout
04-29 17:17:00.214: E/AndroidRuntime(7191): at com.example.rtmp02.UnityRtmp.onCreate(UnityRtmp.java:30)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.app.Activity.performCreate(Activity.java:5231)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2201)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.app.ActivityThread.access$800(ActivityThread.java:144)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.os.Handler.dispatchMessage(Handler.java:102)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.os.Looper.loop(Looper.java:212)
04-29 17:17:00.214: E/AndroidRuntime(7191): at android.app.ActivityThread.main(ActivityThread.java:5135)
04-29 17:17:00.214: E/AndroidRuntime(7191): at java.lang.reflect.Method.invokeNative(Native Method)
04-29 17:17:00.214: E/AndroidRuntime(7191): at java.lang.reflect.Method.invoke(Method.java:515)
04-29 17:17:00.214: E/AndroidRuntime(7191): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
04-29 17:17:00.214: E/AndroidRuntime(7191): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
04-29 17:17:00.214: E/AndroidRuntime(7191): at dalvik.system.NativeStart.main(Native Method)
I think this line
java.lang.NoClassDefFoundError: com.example.rtmp02.R $ layout
But I do not know how to solve.
I found the problem.
Modify the file extension .jar to .zip
Jar file Incomplete.
Because the use of automatically generated problem.
Finally, to solve the problem manually generated JAR.
Thanks.
I dont understand this error from my .apk app
This is my link I need help. Thanks
Please, if you know write on my link. thanks