Bug? Error while invoking Sdk Manager

Discussion in 'Bugs & wishlist' started by cimperia, Jul 14, 2019.

  1. cimperia

    cimperia Active Member Licensed User

    When I invoke B4A Sdk Manager, it always displays this error:
    Error Could not find or load main class Dell\AppData\Local\Temp

    OS: Windows 10
    b4A: 9.30

    I believe the error might be caused because the user's folder contains a space. It's located in

    C:\Users\userName Dell\

    upload_2019-7-14_16-26-28.png
     

    Attached Files:

  2. cimperia

    cimperia Active Member Licensed User

    The error is indeed caused by the space in the user's folder. I've temporally changed the folder name to remove the space and no more errors. But, I need to keep the folder name as it was, ie with a space.

    Any possibility of a quick fix?

    There's the same issue with avd manager.
     
    Last edited: Jul 14, 2019
  3. Erel

    Erel Administrator Staff Member Licensed User

    Use the ready to run SDK for now. The fix requires an update to the IDE.

    Please check it again when the next beta is released (it will probably take a few months).
     
  4. cimperia

    cimperia Active Member Licensed User

  5. Erel

    Erel Administrator Staff Member Licensed User

    No. In most cases you don't need to run anything as it includes the required components.
     
  6. cimperia

    cimperia Active Member Licensed User

    I did that and the error is still there.

    The issue is with B4ASdkManager.b4j.

    The fix is passing the Java Option(s) as an array.

    I suppose it'll prevent the tokeniser from splitting strings at spaces.

    Code:
    Public Sub SetEnvironment(s As Shell)
        s.SetEnvironmentVariables(CreateMap(
    "JAVA_HOME": FindJava, _
            
    "JAVA_OPTS[@]"$"-Djava.io.tmpdir=${File.DirTemp}"$))
     
    '    s.SetEnvironmentVariables(CreateMap("JAVA_HOME": FindJava, _
    '        "JAVA_OPTS": $"-Djava.io.tmpdir=${File.DirTemp}"$))
    End Sub
    AVD manager is working ok, too.
     
    Last edited: Jul 15, 2019
    Erel likes this.
  7. Erel

    Erel Administrator Staff Member Licensed User

    Interesting solution. I've implemented a different one. Please test it when the next beta is released.
     
    Peter Simpson likes this.
  8. Erel

    Erel Administrator Staff Member Licensed User

    Continuing the discussion here.

    - Make sure to use B4ASdkManager.jar that was included in v9.50.
    - Run the IDE with logs enabled: https://www.b4x.com/android/forum/posts/50478/
    It should print the temp folder. Something like:

    TempFolder: C:\Users\H\AppData\Roaming\ANYWHE~1\BASIC4~1\temp

    Do you see it?
     
  9. cimperia

    cimperia Active Member Licensed User

    Yes, I get this result and notice the space in the path.

    TempFolder: C:\Users\User Dell\AppData\Local\Temp\

    When I check TempFolder, no log gets created there when running SDK manager or by B4A.

    I suggested a fix in a post above, would it still be applicable?
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    It looks like a combination of two issues:
    - The space in the user name.
    - The file system doesn't support the old DOS style paths.

    You can force B4A to use a different folder by adding an environment variable named B4A_TEMP. Set it to c:\temp and try again.
     
  11. cimperia

    cimperia Active Member Licensed User

    That fixed it. SDK & AVD managers now run correctly. Thank you.
     
    Erel likes this.
  12. Erel

    Erel Administrator Staff Member Licensed User

    BTW, the B4A_TEMP variable is a new feature in v9.50.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice