audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

iOS crash with EXC_BAD_ACCESS

Open YBill opened this issue 1 year ago • 5 comments

Checklist

  • [X] I read the troubleshooting guide before raising this issue
  • [X] I made sure that the issue I am raising doesn't already exist

Current bug behaviour

I run the project on iOS and play an audio file. It crashes after playing for a while. After observation, it will definitely crash. Some network audio files will crash after playing for dozens of seconds. The local audio file provided in my demo will crash after playing for about 5 seconds. I suspect it's a Flutter error.

Expected behaviour

Audio should play normally as expected

Steps to reproduce

1、open the app 2、Playing audio using the audioplayers library

Code sample

Firebase related libraries added Firebase related libraries are added, here is a crashlytics
  firebase_crashlytics: ^4.0.3
Vungle ads added When adding Admob mediation ads, be sure to add Vungle. And Key is added, you can initialize it or not
  # Admob
  google_mobile_ads: ^5.1.0
  # Vungle ads
  gma_mediation_liftoffmonetize: ^1.0.0
Play Audio Firebase related libraries are added, here is a crashlytics
  audioplayers: ^6.0.0
final player = AudioPlayer();
player.play(AssetSource("audio.mp3"));
Demo I extracted the minimized code that can locate the crash into a demo, which can also be downloaded and run. Below is the Github address

exc_bad_access_demo

Affected platforms

iOS

Platform details

Mac: MacBook Pro(Apple M3 MacOS Sonoma 14.4.1) Xcode Version: 15.3 iPhone: 8 Plus (iOS 16.7.2)

AudioPlayers Version

6.0.0

Build mode

debug, profile, release

Audio Files/URLs/Sources

No response

Screenshots

No response

Logs

my relevant logs
Full Logs
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  frame #0: 0x00000001bdd5881c libswiftCore.dylib`swift::SubstGenericParametersFromMetadata::SubstGenericParametersFromMetadata(swift::TargetMetadata<swift::InProcess> const*) + 24
libswiftCore.dylib`swift::SubstGenericParametersFromMetadata::SubstGenericParametersFromMetadata:
->  0x1bdd5881c <+24>: ldr    x9, [x1]
  0x1bdd58820 <+28>: cmp    x9, #0x7ff
  0x1bdd58824 <+32>: csel   w9, wzr, w9, hi
  0x1bdd58828 <+36>: cmp    w9, #0x202
Target 0: (Runner) stopped.
Lost connection to device.

Flutter doctor:

[✓] Flutter (Channel stable, 3.24.0, on macOS 14.4.1 23E224 darwin-arm64, locale
  zh-Hans-CN)
  • Flutter version 3.24.0 on channel stable at
    /Users/Bill/Library/Android/flutter
  • Upstream repository https://github.com/flutter/flutter.git
  • Framework revision 80c2e84975 (2 weeks ago), 2024-07-30 23:06:49 +0700
  • Engine revision b8800d88be
  • Dart version 3.5.0
  • DevTools version 2.37.2


[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
  • Android SDK at /Users/Bill/Library/Android/sdk
  • Platform android-34, build-tools 34.0.0
  • ANDROID_HOME = /Users/Bill/Library/Android/sdk
  • Java binary at: /Applications/Android
    Studio.app/Contents/jbr/Contents/Home/bin/java
  • Java version OpenJDK Runtime Environment (build
    17.0.9+0-17.0.9b1087.7-11185874)
  • All Android licenses accepted.


[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
  • Xcode at /Applications/Xcode.app/Contents/Developer
  • Build 15E204a
  • CocoaPods version 1.15.2


[✓] Chrome - develop for the web
  • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome


[✓] Android Studio (version 2023.2)
  • Android Studio at /Applications/Android Studio.app/Contents
  • Flutter plugin can be installed from:
    🔨 https://plugins.jetbrains.com/plugin/9212-flutter
  • Dart plugin can be installed from:
    🔨 https://plugins.jetbrains.com/plugin/6351-dart
  • Java version OpenJDK Runtime Environment (build
    17.0.9+0-17.0.9b1087.7-11185874)


[✓] IntelliJ IDEA Community Edition (version 2024.1)
  • IntelliJ at /Applications/IntelliJ IDEA CE.app
  • Flutter plugin can be installed from:
    🔨 https://plugins.jetbrains.com/plugin/9212-flutter
  • Dart plugin can be installed from:
    🔨 https://plugins.jetbrains.com/plugin/6351-dart


[✓] VS Code (version 1.88.1)
  • VS Code at /Applications/Visual Studio Code.app/Contents
  • Flutter extension can be installed from:
    🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter


[✓] Connected device (4 available)
  • Bill的iPhone (mobile)         • 406c38754ab4a268b2f54a5d7109f8f83ea81c2a
    • ios            • iOS 16.7.2 20H115
  • macOS (desktop)                 • macos
    • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
  • Mac Designed for iPad (desktop) • mac-designed-for-ipad
    • darwin         • macOS 14.4.1 23E224 darwin-arm64
  • Chrome (web)                    • chrome
    • web-javascript • Google Chrome 127.0.6533.101
  ! Error: Browsing on the local area network for Shaw’s iPhone. Ensure the
    device is unlocked and attached with a cable or associated with the same
    local area network as this Mac.
    The device must be opted into Developer Mode to connect wirelessly. (code
    -27)


[✓] Network resources
  • All expected network resources are available.

Related issues / more information

I am not sure what the problem is. I have also submitted related issues on Flutter. issues

Working on PR

no way

YBill avatar Aug 16 '24 03:08 YBill

I submitted an issue to Flutter, and they said it should be a problem with the third-party library

YBill avatar Aug 16 '24 13:08 YBill

any solutions ????

ziad500 avatar Mar 12 '25 15:03 ziad500

any solutions ????

I used the just_audio library instead

YBill avatar Mar 13 '25 07:03 YBill

any update

rajaflutter7 avatar Apr 04 '25 05:04 rajaflutter7