Sithira / FlutterRadioPlayer

Flutter Radio Player, A Plugin to handle streaming audio without a hassle
MIT License
139 stars 64 forks source link

Android building problem #42

Closed vinzaceto closed 2 years ago

vinzaceto commented 3 years ago

Hi, thank you for your work. I'm trying to use the library on Android but i'm getting error on building phase:

**e: /Users/acetovi/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.7/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (121, 90): Type mismatch: inferred type is String? but String was expected e: /Users/acetovi/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.7/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (123, 63): Type mismatch: inferred type is String? but String was expected e: /Users/acetovi/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.7/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (174, 32): Type mismatch: inferred type is String? but String was expected

FAILURE: Build failed with an exception.**

On IOS device no problems.

Can you help me with this? Thanks

vinzaceto commented 3 years ago

No one has my same problem? Can you share your android and configuration? It's very important guys. Thank you

Darryl1702 commented 3 years ago

I'm also getting this error on Android. Don't know about iOS though.

frzjac commented 3 years ago

I have the same problem too

nmeri17 commented 3 years ago

This seems to be a similar issue https://github.com/Sithira/FlutterRadioPlayer/issues/26, so I tried both solutions mentioned there, yet none worked. @vinzaceto did you port to another package or find a way around this?

Sithira commented 3 years ago

@nmeri17 can you attach your logs here ?

nmeri17 commented 3 years ago

@nmeri17 can you attach your logs here ?

It's identical to the one OP is getting. The only difference is in the version numbers when I tried rolling back to 1.0.5 (instead of ^1.0.7), and of course, the PC paths. I deleted "build" folder also and reran, but that didn't help

I only succeeded in building after commenting out the package from pubspec and commenting out the entire file the plugin was being used in

Sithira commented 3 years ago

@nmeri17 can you attach your logs here ?

It's identical to the one OP is getting. The only difference is in the version numbers when I tried rolling back to 1.0.5 (instead of ^1.0.7), and of course, the PC paths. I deleted "build" folder also and reran, but that didn't help

I only succeeded in building after commenting out the package from pubspec and commenting out the entire file the plugin was being used in

Can you try in below steps ?

  1. Remove the FRP from your app. Comment whatever code that is related with the FRP.
  2. Do a clean build ( this time there should be no FRP in your app )
  3. Now install the package (1.0.7)
  4. Check if the build is passing now ( still don't uncomment your business logic )
  5. If the build is passing then you may uncomment your application logic related to FRP
nmeri17 commented 3 years ago

I repeated those steps just to be sure; the results were always the same. I am stuck on step 4, which has the stack trace

Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-1.0.7\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (121, 90): Type mismatch: inferred type is String? but String was expected e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-1.0.7\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (123, 63): Type mismatch: inferred type is String? but String was expected e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-1.0.7\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (174, 32): Type mismatch: inferred type is String? but String was expected

FAILURE: Build failed with an exception.

nmeri17 commented 3 years ago

I just tried some trick -- installing the package and uncommenting the relevant widget class while the build is running on the emulator. I hot-restarted the app and it kept running successfully. However, the radio doesn't play. It throws an error with a rather lengthy stack trace, which can be found at this bin https://pastebin.com/HQgktHej

vinzaceto commented 3 years ago

Same problem here. I would like to add other information. I tried to compile passing from flutter 1 to Flutter 2 and the situation worsened. The library is not compliant to the null safety.

nmeri17 commented 3 years ago

@Sithira in case you are having difficulty reproducing, this issue arose after trying to build a signed app bundle. Prior to that, I was able to build and deploy debug versions on the emulator or real device. Please let me know if you are able to make any progress identifying the issue

nmeri17 commented 3 years ago

Hi @Sithira No response from you yet. I've tried downgrading to version 1.0.0 but the issue persisted. Which means it's not a version issue. The only other major update I made was to the gradle bundle version. The distribution version at gradle/wrapper/gradle-wrapper.properties was 5.4.x. I think your code is incompatible with this gradle version and I'm unable to build signed release bundles with any lower version. Can you try updating your gradle version to 6.5 and see if you can replicate and perhaps fix the issue? Many thanks

murilots commented 3 years ago

I have same problem.

Sithira commented 2 years ago

Kindly update to newest version