致命异常:main java.lang.noclassdeffounderror:android.media.audioattributes$builder

zfciruhq  于 2021-08-25  发布在  Java
关注(0)|答案(0)|浏览(266)

我在一个flutt中制作了一个游戏,我在google play console中进行了测试,在发布前的报告中发现了一个错误。有人能帮我修复这个错误吗
崩溃和anrs崩溃错误
测试期间在1台设备上检测到
io.flatter.embedding.engine.flatterJNI.handleplatformmessage()处的堆栈跟踪

FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: android.media.AudioAttributes$Builder
    at e.a.a.f$b.b()
    at e.a.a.f$b.a()
    at e.a.a.f.<clinit>()
    at e.a.a.a.h()
    at e.a.a.a.m()
    at e.a.a.a.a()
    at c.a.c.a.i$a.a()
    at io.flutter.embedding.engine.e.b.c()
    at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage()
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:132)
    at android.os.Looper.loop(Looper.java:138)
    at android.app.ActivityThread.main(ActivityThread.java:5419)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
    at dalvik.system.NativeStart.main(Native Method)

三星galaxy s3 720x1280安卓4.3(sdk 18)
我使用play assets audio来播放按钮点击声音,我在Flatter中使用AudioPlayer插件,并使用audiocache以低延迟模式加载资产音频文件,它与我的物理设备完美配合,但当我在google play console中测试它时,我发现上述错误,我使用getx controller在我的所有屏幕上播放音频

late AudioCache audioPlayer;
 RxBool volume = true.obs;

void playAudio(String name) {
    volume.isTrue
        ? audioPlayer.play(name, mode: PlayerMode.LOW_LATENCY)
        // ignore: unnecessary_statements
        : null;
  }

 @override
  void onInit() {
    audioPlayer = AudioCache();
    audioPlayer.loadAll([
      "BClick.wav",
      "play.mp3",
      "ForFite.wav",
      "Done.wav",
      "Exit.wav",
      "Timer.mp3"
    ]);
    super.onInit();
  }

on pressed (){
allControllers.playAudio("BClick.wav");
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题