FrameLayout error on Android

Hello

I am using TMS FNC Cloud Pack v1.4.2.0 and TMS FNC Core v2.8.1.5 in Delphi 11.0 FMX. On certain Android installations (Samsung Galaxy Tab A running Android 11, Lenovo TB-X304F running Android 8.1) I am seeing the following error when attempting to access Dropbox and Google Drive:

'java.lang.IllegalArgumentException: Given view not a child of android.widget.FrameLayout{b92c6cb V.E...... ......ID 0,32-800,1216 #1020002 android:id/content}'.

I could find no mention of this error in the TMS fora or searching the web. Is this a known error? Are there instructions for a work-around.

Thanks

David

This is the first time we encounter this, when does this error popup, is this during authentication?

When I turn on logging and access Dropbox from Android, where is the log file written?

The LogFileName property is the name of the log file by default and saved into the documents folder by default. If that doesn't exist or is not accessible on your device, this could potentially be the issue. You can specify your own path by just adding your own path and filename to the LogFileName property.

Running on Android, I left the design-time value of LogFileName as 'TTMSFNCCloudDropBox.LOG'. I set Logging to True. That didn't produce a log file in any of the Documents folders on the device or on my PC.

Next I tried setting the LogFileName to each of the values below. None of them produced a log file on the device that I could find:

//Dropbox.LogFileName := TPath.Combine(TPath.GetTempPath, 'TTMSFNCCloudDropBox.LOG');
//Dropbox.LogFileName := TPath.Combine(TPath.GetSharedDocumentsPath, 'TTMSFNCCloudDropBox.LOG');
//Dropbox.LogFileName := TPath.Combine(TPath.GetDocumentsPath, 'TTMSFNCCloudDropBox.LOG');
//Dropbox.LogFileName := TPath.Combine(TPath.GetSharedDownloadsPath, 'TTMSFNCCloudDropBox.LOG');
//Dropbox.LogFileName := TPath.Combine(TPath.GetDownloadsPath, 'TTMSFNCCloudDropBox.LOG');
Dropbox.LogFileName := TPath.Combine(TPath.GetPublicPath, 'TTMSFNCCloudDropBox.LOG');
Dropbox.Logging := True;
DropBox.Connect;

If I didn't do this correctly, or there's something else I should try, please let me know.

Thanks

David

Running in the Delphi debugger, the error in FMX.TMSFNCCloudBase line 807, method TTMSFNCCustomCloudBase.InternalExecuteRequest, command FCloudBase.ExecuteRequest(ARequest);.

Here is the console output for the error:

11-18 09:21:16.911: I/adero.FormVale(4226): Thread[4,tid=4253,WaitingInMainSignalCatcherLoop,Thread*=0x70237d5000,peer=0x12c80000,"Signal Catcher"]: reacting to signal 3
11-18 09:21:16.916: I/SurfaceView(4226): onWindowVisibilityChanged(8) false com.embarcadero.firemonkey.form.FormView{8ecbd90 VFE...... ......I. 0,0-0,0} of ViewRootImpl@3092b92[FMXNativeActivity]
11-18 09:21:16.923: I/SurfaceView(4226): onWindowVisibilityChanged(8) false com.embarcadero.firemonkey.form.FormView{f1a053 VFE...... ......I. 0,0-0,0} of ViewRootImpl@3092b92[FMXNativeActivity]
11-18 09:21:16.926: I/System.out(4226): (HTTPLog)-Static: isSBSettingEnabled false
11-18 09:21:16.926: I/System.out(4226): (HTTPLog)-Static: isSBSettingEnabled false
11-18 09:21:24.083: W/System.err(4226): java.lang.IllegalArgumentException: Given view not a child of android.widget.FrameLayout{af44245 V.E...... ......ID 0,32-1280,736 #1020002 android:id/content}
11-18 09:21:24.084: W/System.err(4226): at android.view.ViewGroup.updateViewLayout(ViewGroup.java:5893)
11-18 09:21:24.084: W/System.err(4226): at com.embarcadero.rtl.ProxyInterface.dispatchToNative(Native Method)
11-18 09:21:24.084: W/System.err(4226): at com.embarcadero.rtl.ProxyInterface.invoke(ProxyInterface.java:21)
11-18 09:21:24.085: W/System.err(4226): at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
11-18 09:21:24.085: W/System.err(4226): at $Proxy9.onTouchEvent(Unknown Source)
11-18 09:21:24.085: W/System.err(4226): at com.embarcadero.firemonkey.form.FormView.onTouchEvent(FormView.java:39)
11-18 09:21:24.085: W/System.err(4226): at android.view.View.dispatchTouchEvent(View.java:15199)
11-18 09:21:24.085: W/System.err(4226): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920)
11-18 09:21:24.085: W/System.err(4226): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3594)
11-18 09:21:24.085: W/System.err(4226): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920)
11-18 09:21:24.085: W/System.err(4226): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3594)
11-18 09:21:24.085: W/System.err(4226): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920)
11-18 09:21:24.086: W/System.err(4226): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3594)
11-18 09:21:24.086: W/System.err(4226): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920)
11-18 09:21:24.086: W/System.err(4226): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3594)
11-18 09:21:24.086: W/System.err(4226): at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:915)
11-18 09:21:24.086: W/System.err(4226): at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1957)
11-18 09:21:24.086: W/System.err(4226): at android.app.Activity.dispatchTouchEvent(Activity.java:4182)
11-18 09:21:24.086: W/System.err(4226): at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:873)
11-18 09:21:24.086: W/System.err(4226): at android.view.View.dispatchPointerEvent(View.java:15458)
11-18 09:21:24.086: W/System.err(4226): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7457)
11-18 09:21:24.087: W/System.err(4226): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7233)
11-18 09:21:24.087: W/System.err(4226): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6595)
11-18 09:21:24.087: W/System.err(4226): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6652)
11-18 09:21:24.087: W/System.err(4226): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6618)
11-18 09:21:24.087: W/System.err(4226): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6819)
11-18 09:21:24.087: W/System.err(4226): at android.view.ViewRootImpl$NativePostImeInputStage.onFinishedInputEvent(ViewRootImpl.java:7176)
11-18 09:21:24.087: W/System.err(4226): at android.view.InputQueue.finishInputEvent(InputQueue.java:136)
11-18 09:21:24.087: W/System.err(4226): at android.os.MessageQueue.nativePollOnce(Native Method)
11-18 09:21:24.087: W/System.err(4226): at android.os.MessageQueue.next(MessageQueue.java:335)
11-18 09:21:24.087: W/System.err(4226): at android.os.Looper.loop(Looper.java:206)
11-18 09:21:24.088: W/System.err(4226): at android.app.ActivityThread.main(ActivityThread.java:8653)
11-18 09:21:24.088: W/System.err(4226): at java.lang.reflect.Method.invoke(Native Method)
11-18 09:21:24.088: W/System.err(4226): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
11-18 09:21:24.088: W/System.err(4226): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

At FCloudBase.ExecuteRequest(ARequest) it appears to me that FCloudBase is defined as type

FCloudBase: void *

I don't know how to get the debugger to show the actual type of FCloudBase or to show the object owning the ExecuteRequest method that is being run.

David

We are currently investigating this here.

So we have tested this here in a new blank application and followed these steps:

  1. Add JavaScriptHelper.jar & FNCWebChromeClient.jar to the libraries folder in your project
  2. Drop an instance of TTMSFNCCloudDropBox on the form
  3. Drop a button on the form
  4. Assign the following code:
procedure TForm1.Button1Click(Sender: TObject);
begin
  TMSFNCCloudDropBox1.Connect;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFNCCloudDropBox1.Authentication.ClientID := 'xxxxxx';
  TMSFNCCloudDropBox1.Authentication.Secret := 'xxxxx';
  TMSFNCCloudDropBox1.Authentication.CallBackURL := 'http://127.0.0.1:8888';
  TMSFNCCloudDropBox1.PersistTokens.Key := TTMSFNCUtils.AddBackslash(TTMSFNCUtils.GetDocumentsPath) + TMSFNCCloudDropBox1.ClassName + '.ini';
  TMSFNCCloudDropBox1.Logging := True;
end;

Clicking on the button, the authentication dialog opens and prompts to login. We cannot reproduce the issue here. Please provide a test application which is able to reproduce this.