danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.
Apache License 2.0
1.21k stars 347 forks source link

Problem with compiling on Delphi 10.3 Android #662

Closed perfektsoft1 closed 10 months ago

perfektsoft1 commented 1 year ago

There is problem with compilation Delphi10.3 Android in unit MVCFramework.Serializer.JsonDataObjects on line with String(AValue.TypeInfo.Name).StartsWith('Nullable') -> WinCellarMobileClient sample. In unit MVCFramework.ActiveRecord there is similar situation solved {$IFDEF NEXTGEN} lName := aValue.TypeInfo.NameFld.ToString; {$ELSE} lName := string(aValue.TypeInfo.Name); {$ENDIF} if (lName.StartsWith('Nullable', True) and (aValue.TypeInfo.Kind = tkRecord)) then

danieleteti commented 1 year ago

Can you show the compiler error?

perfektsoft1 commented 1 year ago

[DCC Error] MVCFramework.Serializer.JsonDataObjects.pas(1615): E2089 Invalid typecast [DCC Error] MVCFramework.Serializer.JsonDataObjects.pas(1635): E2089 Invalid typecast Problem is that for NEXTGEN type of AValue.TypeInfo.Name is byte and String(AValue.TypeInfo.Name) typecast is invalid

danieleteti commented 1 year ago

Not reproducible with the current repo version. Can you double check pleaseusing the repo version? Maybe this issue has been already fixed.

perfektsoft1 commented 1 year ago

I pulled the newest repo version (3.4.0-neon-beta).

I think that the problem occurs in delphi version. 10.3.3 and below.

Update: 10.4 Sydney NEXTGEN symbol has been removed from all compilers, along with AUTOREFCOUNT and WEAKINSTREF symbols.

In delphi 10.3.3 - android - NEXTGEN compiler directive -> TSymbolName is Byte {$IFDEF NEXTGEN} TSymbolName = Byte; {$ELSE NEXTGEN} TSymbolNameBase = string[255]; TSymbolName = type TSymbolNameBase; {$ENDIF NEXTGEN}

danieleteti commented 1 year ago

OK. Can you apply the same approach used in MVCFramework.ActiveRecord and test if it works in your Delphi version? If so, send the changes or create a PR. Thanks

danieleteti commented 11 months ago

Any news?