android - java.lang.NoSuchMethodError:没有直接方法(Lcom/google/android/exoplayer2/upstream/DefaultAllocator;IIJJ)V
问题描述
我正在使用https://github.com/react-native-kit/react-native-track-player这个库,我面临关于 exoplayer 的问题,应用程序在启动时崩溃
版本 react-native: "0.49.0" react-native-track-player: devBranch
java.lang.NoSuchMethodError: No direct method <init>(Lcom/google/android/exoplayer2/upstream/DefaultAllocator;IIJJ)V in class Lcom/google/android/exoplayer2/DefaultLoadControl; or its super classes (declaration of 'com.google.android.exoplayer2.DefaultLoadControl' appears in /data/app/com.test.myapp-OHj1RziNXZi6KAifrwaU0w==/base.apk)
at guichaguri.trackplayer.player.players.ExoPlayback.<init>(ExoPlayback.java:62)
at guichaguri.trackplayer.logic.MediaManager.createLocalPlayback(MediaManager.java:65)
at guichaguri.trackplayer.logic.MediaManager.setupPlayer(MediaManager.java:78)
at guichaguri.trackplayer.logic.components.MediaWrapper.setupPlayer(MediaWrapper.java:36)
at guichaguri.trackplayer.TrackModule$1.run(TrackModule.java:143)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
这是来自 ExoPlayback.class 的依赖错误还是程序错误
我的项目依赖
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.xxx.yyy"
minSdkVersion 16
targetSdkVersion 26
versionCode 2
versionName "0.2.1"
multiDexEnabled true
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
dexOptions {
javaMaxHeapSize "4g"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
repositories {
maven {
url 'http://repo.brightcove.com/releases'
}
}
dependencies {
compile project(':react-native-brightcove-player')
compile project(':react-native-image-picker')
compile project(':react-native-track-player')
compile project(':react-native-text-input-mask')
compile project(':react-native-share')
compile project(':react-native-sound')
compile project(':react-native-pdf')
compile project(':react-native-onesignal')
compile project(':appcenter-crashes')
compile project(':appcenter-analytics')
compile project(':appcenter')
compile project(':react-native-fetch-blob')
compile project(':tipsi-stripe')
compile project(':react-native-payments')
compile project(':react-native-fs')
compile project(':react-native-blur')
compile project(':react-native-picker')
compile project(':react-native-device-info')
compile project(':react-native-extra-dimensions-android')
compile project(':react-native-immersive')
compile project(':react-native-orientation')
compile project(':react-native-splash-screen')
compile project(':react-native-config')
compile project(':react-native-code-push')
compile project(':react-native-video')
compile fileTree(dir: "libs", include: ["*.jar"])
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-linear-gradient')
compile project(':react-native-webview-bridge')
}
解决方案
推荐阅读
- angular - 打开 sans font css Node Module 后 Angular Project 托管不起作用
- kubernetes - 使用 NodePort 类型服务公开私有 kubernetes 集群
- javascript - 解析错误:无效或意外的令牌
- mysql - 无法在 case when 语句中放置子查询条件
- laravel - Laravel 通过模型存储数据
- amazon-ec2 - EC2 实例允许将流量传出到特定网站
- ios - 个人团队未注册 Apple Developer Program
- swift - 离线时删除、添加和更新 Firestore 文档
- java - 带有迭代的 Yelp API 搜索请求 - 如何进行迭代
- c - 调用 globfree() 时出现分段错误