amangautam1/flutter-musicplayer

"Unfortunately Music Player has stopped working" Error when launching App

Closed this issue · 3 comments

I get that error when trying to launch the app. I have updated the code for the Song class and added a default return null in list_songs.dart at line 67 (my IDE showed it as an error due to the lack of a return statement) There are still some warnings showing up, though no errors. Could they be the reason as to why the app isn't starting ? If so how to fix them ? If not what could be the reason ? I am trying to run it on an emulator with Android API 16. Do I need a higher one ?

Warnings:
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\main.dart:14)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\musichome.dart:17)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\musichome.dart:33)
info: This function has a return type of 'Future', but doesn't end with a return statement. (missing_return at [musicplayer] lib\musichome.dart:238)
info: 'child' is deprecated and shouldn't be used. (deprecated_member_use at [musicplayer] lib\musichome.dart:246)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\pages\card_detail.dart:10)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\pages\card_detail.dart:23)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\pages\list_songs.dart:10)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\pages\list_songs.dart:22)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\pages\material_search.dart:8)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\pages\material_search.dart:18)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\pages\now_playing.dart:9)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\pages\now_playing.dart:21)
info: The value of the local variable 'i' isn't used. (unused_local_variable at [musicplayer] lib\pages\now_playing.dart:475)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\pages\settings.dart:14)
info: Field doesn't override an inherited getter or setter. (override_on_non_overriding_field at [musicplayer] lib\pages\settings.dart:32)
info: Unused import: 'dart:typed_data'. (unused_import at [musicplayer] lib\util\utility.dart:2)
info: Unused import: 'dart:io'. (unused_import at [musicplayer] lib\views\album.dart:1)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\views\album.dart:9)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\views\album.dart:18)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\views\artists.dart:6)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\views\artists.dart:15)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\views\home.dart:13)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\views\home.dart:22)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\views\playlists.dart:5)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\views\playlists.dart:15)
info: This method overrides a method annotated as @mustCallSuper in 'State', but does not invoke the overridden method. (must_call_super at [musicplayer] lib\views\playlists.dart:20)
info: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final). (must_be_immutable at [musicplayer] lib\views\songs.dart:10)
info: Name types using UpperCamelCase. (camel_case_types at [musicplayer] lib\views\songs.dart:20)

Alright I checked and the Android API seemed to have been the problem. Starting with an up to date emulator works. Do you know what the lowest API is possible to use with the app / how to change it ?
Also fetching local songs doesnt seem to work it loads forever. I put 3 songs on the emulated device with the android file explorer into sdcard/music/ but it seems the app cant detect them

Did you check it on any real device? Is there same problem exists ?

Fixed