Recent

Author Topic: Panic error: /usr/bin/ant clean -Dtouchtest.enabled=true debug  (Read 348 times)

RDL

  • New Member
  • *
  • Posts: 44
Hey. I'm trying to install android support in lazarus. I am usinghttps://forum.lazarus.freepascal.org/index.php?topic=42527 instruction.
After installation, I get an error at compile time.

What am I doing wrong?
Sorry for my english, google translation!

RDL

  • New Member
  • *
  • Posts: 44
Re: Panic error: /usr/bin/ant clean -Dtouchtest.enabled=true debug
« Reply #1 on: July 19, 2019, 02:16:46 pm »
I found that if the emulator's terminal is an "xfce4-terminal", then Lazarus gives an error. If I remove the "xfce4-terminal" and install the "xterm", there will be no errors when building it. Is it possible to somehow specify in lamw through which terminal emulator to work?
Sorry for my english, google translation!

RDL

  • New Member
  • *
  • Posts: 44
Re: Panic error: /usr/bin/ant clean -Dtouchtest.enabled=true debug
« Reply #2 on: July 21, 2019, 01:55:57 pm »
Code: Pascal  [Select]
  1. function TApkBuilder.BuildByAnt: Boolean;
  2. var
  3.   Tool: TIDEExternalToolOptions;
  4. begin
  5.   Result := False;
  6.   Tool := TIDEExternalToolOptions.Create;
  7.   try
  8.     Tool.Title := 'Building APK (Ant)... ';
  9.  
  10.     {$ifdef darwin}
  11.     Tool.EnvironmentOverrides.Add('JAVA_HOME=${/usr/libexec/java_home}');
  12.     {$else}
  13.     Tool.EnvironmentOverrides.Add('JAVA_HOME=' + FJdkPath);
  14.     {$endif}
  15.  
  16.     Tool.WorkingDirectory := FProjPath;
  17.     Tool.Executable := IncludeTrailingPathDelimiter(FAntPath) + 'ant'{$ifdef windows}+'.bat'{$endif};
  18.  
  19.     if not FileExists(Tool.Executable) then
  20.       raise Exception.CreateFmt('Ant bin (%s) not found! Check path settings', [Tool.Executable]);
  21.  
  22.     Tool.CmdLineParams := 'clean -Dtouchtest.enabled=true debug';
  23.  
  24.  
  25.     // tk Required for Lazarus >=1.7 to capture output correctly
  26. {$if lcl_fullversion >= 1070000}
  27.     Tool.ShowConsole := True;
  28. {$endif}
  29.     // end tk
  30.     Tool.Scanners.Add(SubToolAnt);
  31.     if not RunExternalTool(Tool) then
  32.       raise Exception.Create('Cannot build APK!');
  33.     Result := True;
  34.   finally
  35.     Tool.Free;
  36.   end;
  37. end;

In the xfce4 environment, the TApkBuilder.BuildByAnt code does not work correctly.
All parameters from Tool.CmdLineParams will be applied to xfce4-terminal and not to the program specified in Tool.Executable.

If string
Tool.CmdLineParams := 'clean -Dtouchtest.enabled=true debug';

to replace
Tool.CmdLineParams := '-e "'+Tool.Executable+' clean -Dtouchtest.enabled=true debug"';

then the build was successful. This is provided that there is not a single running xfce4 terminal.
I consider that it is necessary to use for assembly not the terminal of an environment, but xterm.
How can I indicate that the build will go through xterm?
Sorry for my english, google translation!