Hi,
I can't resolve this error which only occurs in release build. Do you have any suggestion? Thank you!
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
*** mainpage: B4XPage_Created
Can use persistant uri!
*** mainpage: B4XPage_Appear
** Activity (main) Resume **
cvmap_update_centerlatlng (java line: 1602)
java.lang.Exception: Sub fcvmap_centerlatlngchanged was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:227)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1069)
at b4a.example.cvmap._update_centerlatlng(cvmap.java:1602)
at b4a.example.cvmap._setcenterlatlng(cvmap.java:1315)
at b4a.example.cvmap._loadlayout(cvmap.java:956)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.keywords.Common$12.run(Common.java:1212)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
Thanks Erel but I added the event and the type TLatLng is not recognized by the IDE (Are you missing a library reference?).
I changed the type to TmapLatLng but there is the this build error: java.lang.Exception: Sub fcvmap_centerlatlngchanged signature does not match expected signature.
What am I doing wrong?
Hi, This b4Xlib contains a custom view (cvMap) which can display Open Street Map. The tiles are retrieved from the internet and cached in a database. You can add shapes and images on the map. UI : - Lat/lng Center of the map - Zoom Level - Compass Direction with rotation - Scale - Button...
I'll try to explain myself better.
In my B4Xpages project I have inserted the B4Xmap additional library and placed the cvmap view on the visual designer.
Following Erel's suggestion, I have added the event fcvMap_CenterLatLngChanged through the generate members function: Private Sub fcvMap_CenterLatLngChanged(aOldlatLng As TLatLng,aNewLatLng As TLatLng)
End Sub
As soon as I launch the release build I get this error: B4A Version: 12.50
Parsing code. Error
Error parsing program.
Error description: Unknown type: tlatlng
Are you missing a library reference?
Error occurred on line: 564 (B4XMainPage)
Private Sub fcvMap_CenterLatLngChanged(aOldlatLng As TLatLng,aNewLatLng As TLatLng)
It seems that the Tlatlng type does not exist in the B4Xmap library, instead the TMapLatLng type of the library does not work with this event (signature error).
Using the debug mode build, without the previous event, the application works perfectly on my tablet.
Thanks for your help.
I solved the problem:
events created from the designer are wrong. I copied the events from the B4Xmap library example and now the realease building works!
I solved the problem:
events created from the designer are wrong. I copied the events from the B4Xmap library example and now the realease building works!
In the library, in cvMap the CenterLatLngChanged was defined like this:
B4X:
#event:CenterLatLngChanged(aOldLatLng as TLatLng,aNewLatLng as TLatLng)
But then in the library in cvMap the event was raised like this:
B4X:
Public Sub Update_CenterLatLng
If fViewCenterLatLng.IsInitialized Then
fViewCenterLatLng.Text=$"Lat : ${NumberFormat2(fMap.fCenterLatLng.fLat,1,5,5,False)} | Lng : ${NumberFormat2(fMap.fCenterLatLng.fLng,1,5,5,False)}"$
End If
If SubExists(mCallBack,mEventName & "_centerLatLngChanged") Then
CallSub2(mCallBack,mEventName & "_centerLatLngChanged",fMap.fCenterLatLng)
End If
End Sub
So two arguments in the event definition, but only only one argument passed when the event was called.
This caused a problem when you used the generate members function as two arguments were expected, but only one was passed.
To me it looks the generated error description:
Error description: Unknown type: tlatlng
Wasn't quite accurate.