状況: AndroidプロジェクトをVisualOnで古いOoyala SDKからExoplyerで最新のOoyala SDKにアップデートしました。 Amazon Fire Stickを介してビデオを再生します。Ooyala SDK for Exoplayer - NoClassDefFoundError:com.ooyala.android.player.exoplayer.ExoStreamPlayer
問題: SDKをアップデートした後、プロジェクトはもう機能しません。
- 「E/AndroidRuntime:致命的な例外:メイン プロセス:com.ISN.firetv_isn、PID:19650 java.lang.NoClassDefFoundErrorが:com.ooyala.android.player.exoplayer私たちは、このエラーメッセージが表示されます。 ExoStreamPlayer "
NoClassDefFoundErrorを見ると、コードにパッケージのインポートがないように感じられます(しかし、全体的には分かりません)。
。
問題の原因を調べてください。解決策は何でしょうか?
のAndroid Studioのエラーログ:
07-12 07:15:15.141 19650-19650/com.ISN.firetv_isn E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ISN.firetv_isn, PID: 19650
java.lang.NoClassDefFoundError: com.ooyala.android.player.exoplayer.ExoStreamPlayer
at com.ooyala.android.player.ExoMoviePlayer.createStreamPlayer(ExoMoviePlayer.java:12)
at com.ooyala.android.player.MoviePlayer.init(MoviePlayer.java:50)
at com.ooyala.android.OoyalaPlayerContextSwitcher.createAndInitPlayer(OoyalaPlayerContextSwitcher.java:107)
at com.ooyala.android.OoyalaPlayer.prepareContent(OoyalaPlayer.java:1469)
at com.ooyala.android.OoyalaPlayerContextSwitcher.processExitAdModes(OoyalaPlayerContextSwitcher.java:182)
at com.ooyala.android.OoyalaPlayerContextSwitcher.processAdModes(OoyalaPlayerContextSwitcher.java:162)
at com.ooyala.android.OoyalaPlayerContextSwitcher.startVideoWorkflow(OoyalaPlayerContextSwitcher.java:61)
at com.ooyala.android.OoyalaPlayer.onCurrentItemChangeComplete(OoyalaPlayer.java:697)
at com.ooyala.android.OoyalaPlayer.access$200(OoyalaPlayer.java:68)
at com.ooyala.android.OoyalaPlayer$1$1.run(OoyalaPlayer.java:510)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5484)
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:984)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
07-12 07:15:15.423 19852-19852/? E/VendorContextExt: Failed to register system service "com.amazon.client.metrics.AndroidMetricsFactoryImpl". The class was not found for the provided classloader.
07-12 07:15:15.806 19044-19867/? E/AmazonAppstore.SideloadedAppManagerService: cannot update entry for package::com.ISN.firetv_isn
07-12 07:15:16.317 19819-19837/? E/SQLiteLog: (283) recovered 3 frames from WAL file /data/user/0/com.amazon.ags.app/databases/gamecircle_provider.db-wal
07-12 07:15:16.334 1005-1050/? E/InputDispatcher: channel '37e18ebe com.ISN.firetv_isn/com.isn.firetv_isn.KindlePlayer (server)' ~ Channel is unrecoverably broken and will be disposed!
コード
package com.isn.firetv_isn;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import com.ooyala.android.*;
import com.ooyala.android.OoyalaPlayer;
import com.ooyala.android.OoyalaPlayerLayout;
import com.ooyala.android.PlayerDomain;
import com.ooyala.android.ui.OoyalaPlayerLayoutController;
import java.util.Observable;
import java.util.Observer;
public class KindlePlayer extends Activity implements Observer {
private static final String TAG = "This";
private static final String EMBED = "a"; //Embed Code, or Content ID
private static final String PCODE = "b";
private static final String DOMAIN = "http://www.ooyala.com";
private OoyalaPlayer player;
View decorView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE);
setContentView(R.layout.video_player);
decorView = this.getWindow().getDecorView();
OoyalaPlayerLayout playerLayout = (OoyalaPlayerLayout) findViewById(R.id.ooyalaPlayer);
player = new OoyalaPlayer(PCODE, new PlayerDomain(DOMAIN));
//set player controller
OoyalaPlayerLayoutController playerLayoutController = new OoyalaPlayerLayoutController(playerLayout, player);
playerLayoutController.setFullscreenButtonShowing(false);
//player = playerLayoutController.getPlayer();
if(isConnectedOnline()){
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if(cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_MOBILE){
Toast.makeText(KindlePlayer.this, "Now using Mobile Network", Toast.LENGTH_SHORT).show();
}
if (player.setEmbedCode(EMBED)) {
Log.d("Play", "Play");
player.play();
} else {
Log.d(TAG, "Asset failed");
}
} else {
Toast.makeText(KindlePlayer.this, "No Internet Connection", Toast.LENGTH_SHORT).show();
}
}
@Override
protected void onPause() {
super.onPause();
if (player != null) {
Log.d("suspend", "suspend");
player.pause();
}
}
@Override
protected void onResume() {
super.onResume();
if (player != null) {
Log.d("resume", "resume");
player.resume();
player.play();
}
}
@Override
public void update(Observable arg0, Object arg1) {
if (arg0 != player) {
return;
}
if (arg1 == OoyalaPlayer.TIME_CHANGED_NOTIFICATION_NAME) {
return;
}
if (arg1 == OoyalaPlayer.ERROR_NOTIFICATION_NAME) {
final String msg = "Error event received";
if (player != null && player.getError() != null) {
Log.e(TAG, msg, player.getError());
}
else {
Log.e(TAG, msg);
}
return;
}
Log.d(KindlePlayer.class.getSimpleName(), "Notification Received: " + arg1 + " - state: " + player.getState());
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_IMMERSIVE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);}
}
public boolean isConnectedOnline() {
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
return ni != null && ni.isConnected();
}// end isConnectedOnline
}