Android Tutorial GUI SDK Manager for newer versions of Android tools

Discussion in 'Tutorials & Examples' started by Erel, May 29, 2017.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Can you run the B4J project with a breakpoint in line 193 and see the values of StdOut and StdErr?
     
  2. Cebuvi

    Cebuvi Active Member Licensed User

    This is what gives me



    StdOut_StdErr.jpg




    Problem solved.
    I have configured JAVA_HOME and everything works.
    Thank you very much.
     
    Last edited: Jun 12, 2017
    Erel and DonManfred like this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    Good point. I will set it automatically for the child processes.
     
    DonManfred likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    V2.05 is released. It fixes the error described in post #22.
     
  5. jimmyF

    jimmyF Active Member Licensed User

    I get this error when I click on AVD Manager:

    Code:
    Error occurred on line: 122 (AVDManager)
    java.lang.ArrayIndexOutOfBoundsException: 
    8
        at b4j.example.avdmanager._parseitem(avdmanager.java:
    1620)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
    etc.
    This is line 122 mentioned above:
    I am not familiar enough with RegEx protocols to spot the actual error in that line of code.
    Code:
    Dim m As Matcher = Regex.Matcher("\s+([^:]+):(.*)", Lines(i))
    Anybody else run into this problem? Or anyone know the solution?
    Thanks
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Please replace the ParseItem code with this sub:
    Code:
    Sub ParseItem(Index() As Int, Lines() As StringAs AVD 'ignore
       Dim AV As AVD
       AV.Initialize
       
    Dim i As Int = Index(0)
       
    Do While i < Lines.Length
         
    Log(Lines(i))
         
    Dim m As Matcher = Regex.Matcher("\s+([^:]+):(.*)", Lines(i))
         
    If m.Find Then
           
    Dim field As String = m.Group(1).Trim
           
    Dim value As String = m.Group(2).Trim
           
    If field = "Name" Then
             AV.Name = value
           
    Else If field = "Target" Then
             
    If value.Length = 0 Then
               value = Lines(i + 
    1).Trim
             
    End If
             AV.Target = value
           
    End If
         
    Else
           
    Exit
         
    End If
         i = i + 
    1
       
    Loop
       Index(
    0) = i - 1
       
    Return AV
    End Sub
    Does it work? If not please post the output logs.
     
    jimmyF likes this.
  7. jimmyF

    jimmyF Active Member Licensed User

    That works just fine. :)
    Thank you!
     
    Erel likes this.
  8. Erel

    Erel Administrator Staff Member Licensed User

    When you say that it works, you mean that you see the list of AVDs, right?
     
  9. jimmyF

    jimmyF Active Member Licensed User

    Yes, I see a list of a grand total of one.
    I have installed other platforms and x86 images but I only display one in the list.
    Platform 24
    Nexus_6P_API_25_b4A

    Log:
    Name: Nexus_6P_API_25_B4A
    Device: Nexus 6P (Google)
    Path: C:\Users\James.SEF2\.android\avd\Nexus_6P_API_25_B4A.avd
    Target: Google APIs
    Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis/x86
    Skin: nexus_6p
    Sdcard: 100M

    My SDK is here:
    E:\Android\sdk\
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Have you tried to create new AVDs with this tool?
     
  11. jimmyF

    jimmyF Active Member Licensed User

    My only choice of Platform is Platform 24.
    I have 25 and 26 installed.
    Okay, I can create a new one:
    Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis/x86
    Skin: nexus_6p
     
  12. jimmyF

    jimmyF Active Member Licensed User

    This is what I have installed:

    DataFolder: C:\Users\James.SEF2\AppData\Roaming\B4ASdkManager
    add-ons;addon-google_apis-google-19
    build-tools;25.0.2
    build-tools;25.0.3
    build-tools;26.0.0
    cmake;3.6.3155560
    docs
    emulator
    extras;android;gapid;3
    extras;android;m2repository
    extras;google;auto
    extras;google;google_play_services
    extras;google;instantapps
    extras;google;m2repository
    extras;google;market_apk_expansion
    extras;google;market_licensing
    extras;google;play_billing
    extras;google;simulators
    extras;google;usb_driver
    extras;google;webdriver
    extras;intel;Hardware_Accelerated_Execution_Manager
    extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.1
    extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2
    extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2
    patcher;v1
    patcher;v4
    platform-tools
    platforms;android-24
    platforms;android-25
    platforms;android-26
    sources;android-24
    sources;android-25
    system-images;android-17;default;x86
    system-images;android-17;google_apis;x86
    system-images;android-18;google_apis;x86
    system-images;android-21;default;x86
    system-images;android-21;default;x86_64
    system-images;android-21;google_apis;x86
    system-images;android-21;google_apis;x86_64
    system-images;android-24;default;x86
    system-images;android-24;default;x86_64
    system-images;android-24;google_apis;x86
    system-images;android-24;google_apis;x86_64
    system-images;android-24;google_apis_playstore;x86
    system-images;android-25;android-tv;x86
    system-images;android-25;android-wear;armeabi-v7a
    system-images;android-25;android-wear;x86
    system-images;android-25;google_apis;x86
    system-images;android-25;google_apis;x86_64
    system-images;android-26;google_apis;x86
    system-images;android-26;google_apis_playstore;x86
    tools
     
  13. iz0ndg

    iz0ndg Member Licensed User

    Hi, i have this error to install selected :
    Code:
    Warning: An error occurred while preparing SDK package Android Support Repository: C:\Windows\PackageOperation01\android_m2repository_r47.zip.
    java.nio.file.NoSuchFileException: C:\Windows\PackageOperation01\android_m2repository_r47.zip
       at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
       at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
       at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
       at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source)
       at java.nio.file.spi.FileSystemProvider.newOutputStream(Unknown Source)
       at java.nio.file.Files.newOutputStream(Unknown Source)
       at com.android.repository.io.impl.FileSystemFileOp.newFileOutputStream(FileSystemFileOp.java:
    247)
       at com.android.repository.io.impl.FileSystemFileOp.newFileOutputStream(FileSystemFileOp.java:
    235)
       at com.android.sdklib.repository.legacy.LegacyDownloader.downloadFully(LegacyDownloader.java:
    82)
       at com.android.repository.impl.installer.BasicInstaller.doPrepare(BasicInstaller.java:
    71)
       at com.android.repository.impl.installer.AbstractPackageOperation.prepare(AbstractPackageOperation.java:
    243)
       at com.android.sdklib.tool.SdkManagerCli.applyPackageOperation(SdkManagerCli.java:
    523)
       at com.android.sdklib.tool.SdkManagerCli.installPackages(SdkManagerCli.java:
    357)
       at com.android.sdklib.tool.SdkManagerCli.run(SdkManagerCli.java:
    147)
       at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:
    119)
       at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:
    93)
    sdkmanager.bat : C:\android-sdk\tools\bin\sdkmanager.bat

    on Win7 32bit java 8u131
     
  14. Jaames

    Jaames Active Member Licensed User

    Almost the same here, Windows 10 64, java 8u131
    I deleted old sdk and Android Studio, witch was about 35Gb , and downloaded sdk tools from the OP link

    Code:
    Info: Parsing E:\Android\sdk\tools\package.xml
    Info: Parsing E:\Android\sdk\tools\package.xml
    Info: Preparing 
    "Install Android Support Repository (revision: 47.0.0)".
    Info: 
    "Install Android Support Repository (revision: 47.0.0)" failed.

    Warning: 
    File C:\Users\james\.android\repositories.cfg could not be loaded.
    Warning: An error occurred 
    while preparing SDK package Android Support Repository: C:\WINDOWS\PackageOperation01\android_m2repository_r47.zip.
    java.nio.file.NoSuchFileException: C:\WINDOWS\PackageOperation01\android_m2repository_r47.zip
        at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
        at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source)
        at java.nio.file.spi.FileSystemProvider.newOutputStream(Unknown Source)
        at java.nio.file.Files.newOutputStream(Unknown Source)
        at com.android.repository.io.impl.FileSystemFileOp.newFileOutputStream(FileSystemFileOp.java:
    247)
        at com.android.repository.io.impl.FileSystemFileOp.newFileOutputStream(FileSystemFileOp.java:
    235)
        at com.android.sdklib.repository.legacy.LegacyDownloader.downloadFully(LegacyDownloader.java:
    82)
        at com.android.repository.impl.installer.BasicInstaller.doPrepare(BasicInstaller.java:
    71)
        at com.android.repository.impl.installer.AbstractPackageOperation.prepare(AbstractPackageOperation.java:
    243)
        at com.android.sdklib.tool.SdkManagerCli.applyPackageOperation(SdkManagerCli.java:
    523)
        at com.android.sdklib.tool.SdkManagerCli.installPackages(SdkManagerCli.java:
    357)
        at com.android.sdklib.tool.SdkManagerCli.run(SdkManagerCli.java:
    147)
        at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:
    119)
        at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:
    93)
     
  15. Erel

    Erel Administrator Staff Member Licensed User

    @Jaames and @iz0ndg, please add this line to the source code and post its output:
    Code:
    Log(GetSystemProperty("java.io.tmpdir""NA"))
    There are no system images available for API 25 or 26 (the main one is missing. It is also missing here).
     
  16. Jaames

    Jaames Active Member Licensed User

    C:\Users\james\AppData\Local\Temp\
     
  17. iz0ndg

    iz0ndg Member Licensed User

    All log after 'Install Selected':
    Code:
    DataFolder: C:\Users\fabio\AppData\Roaming\B4ASdkManager
    C:\Users\fabio\AppData\Local\Temp\
    tools
    tools
    In Panel :

    Code:
    Info: Parsing C:\android-sdk\tools\package.xml
    Info: Parsing C:\android-sdk\tools\package.xml

    Warning: An error occurred 
    while preparing SDK package Android Support Repository: C:\Windows\PackageOperation01\android_m2repository_r47.zip.
    java.nio.file.NoSuchFileException: C:\Windows\PackageOperation01\android_m2repository_r47.zip
       at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:
    79)
       at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:
    97)
       at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:
    102)
       at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:
    230)
       at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:
    434)
       at java.nio.file.Files.newOutputStream(Files.java:
    216)
       at com.android.repository.io.impl.FileSystemFileOp.newFileOutputStream(FileSystemFileOp.java:
    247)
       at com.android.repository.io.impl.FileSystemFileOp.newFileOutputStream(FileSystemFileOp.java:
    235)
       at com.android.sdklib.repository.legacy.LegacyDownloader.downloadFully(LegacyDownloader.java:
    82)
       at com.android.repository.impl.installer.BasicInstaller.doPrepare(BasicInstaller.java:
    71)
       at com.android.repository.impl.installer.AbstractPackageOperation.prepare(AbstractPackageOperation.java:
    243)
       at com.android.sdklib.tool.SdkManagerCli.applyPackageOperation(SdkManagerCli.java:
    523)
       at com.android.sdklib.tool.SdkManagerCli.installPackages(SdkManagerCli.java:
    357)
       at com.android.sdklib.tool.SdkManagerCli.run(SdkManagerCli.java:
    147)
       at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:
    119)
       at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:
    93)
     
    Last edited: Jun 20, 2017
  18. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    Hi, running B4ASdkManager.jar from the Windows PowerShell with Admin Rights solved the above issue and the download started.
     
    Erel likes this.
  19. Jaames

    Jaames Active Member Licensed User

    Can you share PowerShell command tu run jar file as admin here?
     
  20. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    Hi, using windows 10 here, right click on Start Menu gives you another pop up menu from where you can select Windows PowerShell(Admin). UAC Popup dialog will appear, select Yes. Now suppose you downloaded the Jar file to D: Drive. Write in the PowerShell cd d: and press enter. Now write there B4ASdkManager.jar and hit enter. It will run the JAR file and you can install from there. Hope this will solve your issue.
     
    Jaames likes this.
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