我目前正尝试在Android Studio上使用Spotify的SDK制作应用,但是当我从本指南中复制其代码时:https://developer.spotify.com/technologies/spotify-android-sdk/tutorial/
我在这里遇到以下错误:
import com.spotify.sdk.android.authentication.AuthenticationClient;
import com.spotify.sdk.android.authentication.AuthenticationRequest;
import com.spotify.sdk.android.authentication.AuthenticationResponse;
import com.spotify.sdk.android.player.Config;
import com.spotify.sdk.android.player.ConnectionStateCallback;
import com.spotify.sdk.android.player.Error;
import com.spotify.sdk.android.player.Player;
import com.spotify.sdk.android.player.PlayerEvent;
import com.spotify.sdk.android.player.Spotify;
import com.spotify.sdk.android.player.SpotifyPlayer;
public class MainActivity extends AppCompatActivity implements
SpotifyPlayer.NotificationCallback, ConnectionStateCallback
{
他们无法解决“错误”,“PlayerEvent”或“SpotifyPlayer”之类的问题。
我已将.aar文件添加到正确的位置(app / libs)并对gradle进行了更改(运行时没有错误)但除此之外,我不确定我做错了什么。< / p>
这是我的构建gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "" +
""
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// This library handles authentication and authorization
compile(name: 'spotify-auth-1.0.0-beta13', ext: 'aar')
// This library handles music playback
compile(name: 'spotify-player-1.0.0-beta13', ext: 'aar')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
}