ryanheise / audio_session

MIT License
118 stars 84 forks source link

"audio_session Plugin Fails to Respect minSdkVersion 23 After Migration to settings.gradle Plugin Management #145

Open vacating opened 1 month ago

vacating commented 1 month ago

After migrating my Flutter project to the new plugin management method in settings.gradle, here , the audio_session plugin doesn’t respect the global minSdkVersion 23. Despite correctly setting the minSdkVersion in the app/build.gradle, the plugin triggers API-level mismatch errors (e.g., using getId() which requires API 23). This issue forces me to manually enforce the minSdkVersion in settings.gradle.

Steps to Reproduce:

  1. Migrate to the new Flutter plugin management method.
  2. Set minSdkVersion 23 in app/build.gradle.
  3. Include the audio_session plugin.
  4. Run the build and observe the API level mismatch error.

eror we got :

audio_session-0.1.21\android\src\main\java\com\ryanheise\audio_session\AndroidAudioManager.java:272: Error: Call requires API level 23 (current min is 16): android.media.AudioDeviceInfo#getId [NewApi] "id", device.getId(),

@ryanheise

DurgeshSawantWYLD commented 1 month ago

any solution for this, please help the android build is failing

vacating commented 1 month ago

@ryanheise bruv where are u ? we got issue here

khawjaahmad commented 3 weeks ago

I am having a same issue and cannot move forward!

ryanheise/audio_session/AndroidAudioManager.java:272: Error: Call requires API level 23 (current min is 16): android.media.AudioDeviceInfo#getId [NewApi]
                  "id", device.getId(),
                               ~~~~~
bbrockit commented 1 week ago

Has anyone managed to fix this in a local repo or with config changes? I'm getting the same error plus another sdk mismatch with audio_service, which is making calls requiring API 31. I've been going in circles with different java versions, gradle versions, and gradle configs.