无法解析符号 BrightcovePlayer

Cannot resolve symbol BrightcovePlayer

我正在按照 brightcove-native-sdk-android 的 quick start 来实现媒体播放器。

与 build.gradle 的同步通过正常,但是在构建我的应用程序时,出现错误:

无法解析符号 'BrightcovePlayer'。

我认为这与快速入门中提到的存储库有关,但无法破解根本原因。 也关注了这些问题:

目前我的代码如下所示:

MainActivity.java

package com.example.jchavarr.helloworld;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.R;

public class MainActivity extends BrightcovePlayer  {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        brightcoveVideoView  = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
    }
}

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.brightcove.playvideos.MainActivity">

    <!-- Implementing the player from HLS Brightcove-->
    <!-- https://support.brightcove.com/hls-playback-native-sdk-android -->
    <com.brightcove.player.view.BrightcoveExoPlayerVideoView
        android:id="@+id/brightcove_video_view"
        android:layout_width="match_parent"
        android:layout_height="280dp"
        android:layout_gravity="center"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
    />

</android.support.constraint.ConstraintLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.jchavarr.helloworld">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

build.gradle(应用程序)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.example.jchavarr.helloworld"
        minSdkVersion 23
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven {
        url 'http://repo.brightcove.com/releases'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile "com.brightcove.player:exoplayer:4.4+" //**
    //compile 'com.brightcove.player:android-sdk:6.+'
    //compile "com.brightcove.player:android-appcompat-plugin:${anpVersion}"
    testCompile 'junit:junit:4.12'
}

我需要下载某些文件的 AAR 吗? URL http://repo.brightcove.com/releases 是正确的存储库吗? 是否需要放置包裹:package com.brightcove.playvideos;在 MainActivity.java

此修复正在导入一些在快速入门指南中未提及的必需软件包:

import com.brightcove.player.model.DeliveryType;
import com.brightcove.player.model.Video;
import com.brightcove.player.view.BrightcoveExoPlayerVideoView;
import com.brightcove.player.view.BrightcovePlayer;