Wednesday, 31 August 2022
  10 Replies
  852 Visits
  Subscribe
Hi Guys. Just purchased sgcWebSockets. I am have ing the following problems.

Delphi 11.1 IOS 15.6 Windows 10 OSX Monterey.
I have your WebSocket Server Firemonkey running on our win 10 machine.
I have sgcClient Mobile compiled on IOS ( iPad and Iphone ) Windows & OSX

Settings as follows:

client:
HeartBeat.Active := true Interval := 300 TimeOut := 0
WatchDog.enabled := true Attempts := 0 Interval := 10

server:
HeartBeat.Active := true Interval := 300 TimeOut := 0
WatchDog.enabled := true Attempts := 0 Interval := 60

All works fine connected over the same wifi connection.

1. Trying to compile Android 64Bit I get:

[PAClient Error] Error: E7688 Unable to execute '"C:\Program Files\Java\jdk1.8.0_60\bin\java.exe" -cp "c:\program files (x86)\embarcadero\studio\22.0\bin\Android\r8-3.0.73.jar" com.android.tools.r8.D8 --release --min-api 23 --output "D:\techy\delphiComponents\sgcWebSockets_D11\Demos\25.Mobile\01.Mobile Client\Android64\Debug\sgcClientMobile.classes" @"D:\techy\delphiComponents\sgcWebSockets_D11\Demos\25.Mobile\01.Mobile Client\Android64\Debug\dex_list.txt"' (Error 1)
[PAClient Error] Error: E7688 Error in c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\android-support-v4.dex.jar:
[PAClient Error] Error: E7688 java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\android-support-v4.dex.jar
[PAClient Error] Error: E7688 Error in c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-analytics-v2.dex.jar:
[PAClient Error] Error: E7688 java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-analytics-v2.dex.jar
[PAClient Error] Error: E7688 Error in c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-billing.dex.jar:
[PAClient Error] Error: E7688 java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-billing.dex.jar
[PAClient Error] Error: E7688 Error in c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-services.dex.jar:
[PAClient Error] Error: E7688 java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-services.dex.jar
[PAClient Error] Error: E7688 Compilation failed with an internal error.
[PAClient Error] Error: E7688 Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-services.dex.jar
[PAClient Error] Error: E7688 at com.android.tools.r8.utils.w.a(SourceFile:92)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8.main(D8.java:4)
[PAClient Error] Error: E7688 Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-services.dex.jar
[PAClient Error] Error: E7688 at Version.fakeStackEntry(Version_3.0.73.java:0)
[PAClient Error] Error: E7688 at com.android.tools.r8.utils.w.a(SourceFile:68)
[PAClient Error] Error: E7688 at com.android.tools.r8.utils.w.a(SourceFile:28)
[PAClient Error] Error: E7688 at com.android.tools.r8.utils.w.a(SourceFile:27)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.build(BaseCommand.java:2)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8.a(D8.java:4)
[PAClient Error] Error: E7688 at com.android.tools.r8.utils.w.a(SourceFile:84)
[PAClient Error] Error: E7688 ... 1 more
[PAClient Error] Error: E7688 Caused by: java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-services.dex.jar
[PAClient Error] Error: E7688 at com.android.tools.r8.utils.c$b.d(SourceFile:16)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.e(BaseCommand.java:3)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.a(BaseCommand.java:12)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.addProgramFiles(BaseCommand.java:3)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.addProgramFiles(BaseCommand.java:1)
[PAClient Error] Error: E7688 at com.android.tools.r8.b.a(SourceFile:133)
[PAClient Error] Error: E7688 at com.android.tools.r8.b.a(SourceFile:1)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8Command.parse(D8Command.java:1)
[PAClient Error] Error: E7688 ... 3 more
[PAClient Error] Error: E7688 Suppressed: java.lang.RuntimeException: com.android.tools.r8.internal.b: java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-services.dex.jar
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.UA.a(SourceFile:25)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.a(BaseCommand.java:3)
[PAClient Error] Error: E7688 at com.android.tools.r8.utils.w.a(SourceFile:24)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.build(BaseCommand.java:2)
[PAClient Error] Error: E7688 ... 3 more
[PAClient Error] Error: E7688 Caused by: com.android.tools.r8.internal.b: java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-services.dex.jar
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.UA.a(SourceFile:14)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.UA.error(SourceFile:1)
[PAClient Error] Error: E7688 at com.android.tools.r8.utils.c$b.d(SourceFile:17)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.e(BaseCommand.java:3)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.a(BaseCommand.java:12)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.addProgramFiles(BaseCommand.java:3)
[PAClient Error] Error: E7688 at com.android.tools.r8.BaseCommand$Builder.addProgramFiles(BaseCommand.java:1)
[PAClient Error] Error: E7688 at com.android.tools.r8.b.a(SourceFile:133)
[PAClient Error] Error: E7688 at com.android.tools.r8.b.a(SourceFile:1)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8Command.parse(D8Command.java:1)
[PAClient Error] Error: E7688 ... 3 more
[PAClient Error] Error: E7688 [CIRCULAR REFERENCE:java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\google-play-services.dex.jar]

2. When I switch the iPhone to mobile data it looses the connection and won't reconnect. The iPad works okay. It's not a network issue as the Ipad uses the Iphone's personal hotspot. How can I trace the problem.

3. I have added to the client app a notificationCenter and get permissions ok and can send a notification.

procedure TFRMClientMobile.Button1Click(Sender: TObject);
begin
var Notification := NotificationCenter1.CreateNotification;

try
Notification.AlertBody := 'Delphi for Mobile is here!';
Notification.FireDate := Now;

{ Send notification in Notification Center }
NotificationCenter1.PresentNotification(Notification);
finally
Notification.Free;
end;

end;

I also create a notification onMessage

procedure TFRMClientMobile.WSClientMessage(Connection: TsgcWSConnection;
const Text: string);
var
MyNotification: TNotification;
begin
DoLog('#received: ' + Text);
if Text = 'message' then
begin
var Notification := NotificationCenter1.CreateNotification;

try
// Notification.
Notification.AlertBody := 'Our message is ' + Text;
Notification.FireDate := Now;

{ Send notification in Notification Center }
NotificationCenter1.PresentNotification(Notification);
finally
Notification.Free;
end;

This works fine while the app is in the foreground and when returning from the background. But nothing in the background. I need to have the webSocket popup a notification ( as Facebook messenger does on receiving a message )