If you don't find an answer, please click here to post your question.
Reply
Frequent Visitor
Posts: 1
Registered: ‎07-12-2017

Ooyala SDK for Exoplayer-- NoClassDefFoundError: com.ooyala.android.player.exoplayer.ExoStreamPlayer

 

Situation: Updating my Android Project from the old Ooyala SDK with VisualOn to the newest Ooyala SDK with Exoplyer. Plays a video through the Amazon Fire Stick.

 

Problem: After Updating the SDK, the project no longer works. We receive this error message:  

          " E/AndroidRuntime: FATAL EXCEPTION: main
            Process: com.ISN.firetv_isn, PID: 19650
            java.lang.NoClassDefFoundError: com.ooyala.android.player.exoplayer.ExoStreamPlayer"

 

Looking at the NoClassDefFoundError, I feel like the code is missing an import of a class (But, overall I don't know).

 

Can anyone help me locate and fix this problem?

 

 

 

 

Android Studio Log: 

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!

 

Android Studio Project Code:

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  = "QwOWdodDqXerx-f5agXLKMBlfS-SXsoP";  //Embed Code, or Content ID
    private static final String PCODE  = "t3NzgxOleSzQvrNRj0uPn8xWnMlJ";
    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
}
Highlighted
Posts: 1,316
Topics: 178
Kudos: 107
Blog Posts: 78
Ideas: 3
Solutions: 39
Registered: ‎08-20-2012

Re: Ooyala SDK for Exoplayer-- NoClassDefFoundError: com.ooyala.android.player.exoplayer.ExoStreamPl

[ Edited ]

Hi Jackson,

 

 

Sorry for the delay in response, seems your post was put into the community spam box for some strange reason. I just forwarded this on to the Tech Support team for a look. One of our engineers will be reaching out asap.

 

Thanks for posting in the Ooyala Community.

 

Thomas

Please show your appreciation to others. If someone helps you, don't forget to give them Kudos by clicking the star button next to their post. If a post answers your question, please mark it as an "Accepted Solution."




Check out our latest Ooyala Engineering Blog!