Android building problem
Closed this issue · 14 comments
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
No one has my same problem? Can you share your android and configuration? It's very important guys. Thank you
I'm also getting this error on Android. Don't know about iOS though.
I have the same problem too
This seems to be a similar issue #26, so I tried both solutions mentioned there, yet none worked. @vinzaceto did you port to another package or find a way around this?
@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
@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 ?
- Remove the FRP from your app. Comment whatever code that is related with the FRP.
- Do a clean build ( this time there should be no FRP in your app )
- Now install the package (1.0.7)
- Check if the build is passing now ( still don't uncomment your business logic )
- If the build is passing then you may uncomment your application logic related to FRP
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.
- What went wrong:
Execution failed for task ':flutter_radio_player:compileDebugKotlin'.
Compilation error. See log for more details
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
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.
@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
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
I have same problem.
Kindly update to newest version