ilan Expert Licensed User Longtime User Nov 19, 2020 #1 hi i have a map and i put inside mediaplayer objects to play sound. if i want to get back the mediaplayer with an id i get an error when i compile: B4i Version: 6.80 Parsing code. (0.07s) Building folders structure. (0.09s) Compiling code. (0.19s) Compiling layouts code. (0.00s) Compiling debugger engine code. (0.01s) Building Xcode project (0.12s) Sending data to remote compiler. Error B4i line: 25 Dim mp As MediaPlayer = mpMap.Get(id) expected expression Click to expand... this is the code: B4X: Copy If mpMap.ContainsKey(id) Then Dim mp As MediaPlayer = mpMap.Get(id) If mp.IsInitialized Then mp.Pause mpMap.Remove(id) End If End If i managed to compile it in debug mode by comment those lines then uncomment them and click save and it works just fine but i am not able to compile without this trick, why? thanx
hi i have a map and i put inside mediaplayer objects to play sound. if i want to get back the mediaplayer with an id i get an error when i compile: B4i Version: 6.80 Parsing code. (0.07s) Building folders structure. (0.09s) Compiling code. (0.19s) Compiling layouts code. (0.00s) Compiling debugger engine code. (0.01s) Building Xcode project (0.12s) Sending data to remote compiler. Error B4i line: 25 Dim mp As MediaPlayer = mpMap.Get(id) expected expression Click to expand... this is the code: B4X: Copy If mpMap.ContainsKey(id) Then Dim mp As MediaPlayer = mpMap.Get(id) If mp.IsInitialized Then mp.Pause mpMap.Remove(id) End If End If i managed to compile it in debug mode by comment those lines then uncomment them and click save and it works just fine but i am not able to compile without this trick, why? thanx
Erel B4X founder Staff member Licensed User Longtime User Nov 19, 2020 #2 I'm unable to reproduce it. Can you upload a small project with this code? Upvote 0
ilan Expert Licensed User Longtime User Nov 19, 2020 #3 Erel said: I'm unable to reproduce it. Can you upload a small project with this code? Click to expand... thank you erel for your reply. i have sent you the whole project via mail. (i just cannot include some files here in this forum because of license related issue) thanx a lot, ilan Upvote 0
Erel said: I'm unable to reproduce it. Can you upload a small project with this code? Click to expand... thank you erel for your reply. i have sent you the whole project via mail. (i just cannot include some files here in this forum because of license related issue) thanx a lot, ilan
Erel B4X founder Staff member Licensed User Longtime User Nov 20, 2020 #4 It is related to a missing import. Add this to the class code: Code: Copy #if OBJC #import <AVFoundation/AVFoundation.h> #End If It is fixed for the next update. Upvote 0
It is related to a missing import. Add this to the class code: Code: Copy #if OBJC #import <AVFoundation/AVFoundation.h> #End If It is fixed for the next update.