Android Tutorial GUI SDK Manager for newer versions of Android tools

Status
Not open for further replies.

jimmyF

Active Member
Licensed User
Longtime User
Works just fine now!
 

DX94

New Member
Hello, I am trying to port the tool to linux, As far as I reached it finds sdkmanager but now returns an error saying "Error: bash: /c: No such file or directory"

found the code the error comes from in CreateSdkManagerExec, and have a question
What is that "/c" for?
B4X:
allArgs.AddAll(Array("/c", txtPathToSdkManager.Text, "--verbose"))
 

jimmyF

Active Member
Licensed User
Longtime User
 

jimmyF

Active Member
Licensed User
Longtime User
Yes, it did previously work.
In the code:
Log: Error occurred on line: 301 (Main)
Log: java.lang.RuntimeException: Object should first be initialized (List).

So I add code to initialize and the next error is as follows:

Log: Error occurred on line: 337 (Main)
Log: java.lang.ArrayIndexOutOfBoundsException: 1278

I tried to change the upper bound of the index but that failed to correct the problem.
 

jimmyF

Active Member
Licensed User
Longtime User
 

jimmyF

Active Member
Licensed User
Longtime User
Done

 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Thank you.
Might be an encoding issue.

Please change ParseListResult code to:
B4X:
Sub ParseListResult (StdOut As String)
   Dim lines() As String = Regex.Split2("\r\n", Regex.MULTILINE, StdOut)
   Dim index(1) As Int
   Dim CurrentMap As List
   Dim InAvailableItems As Boolean
   Do While index(0) < lines.Length
     Dim line As String = lines(index(0))
     If line.StartsWith("-------") Then
       Log(lines(index(0) - 1)) '<--- breakpoint here
       Select lines(index(0) - 1).Trim
         Case "Installed packages:"
           CurrentMap = InstalledItems
           InAvailableItems = False
         Case "Available Packages:"
           CurrentMap = AvailableItems
           InAvailableItems = True
         Case "Available Updates:"
           InAvailableItems = False
           CurrentMap = UpdateableItems
       End Select
     Else
       If line = "done" Then Exit
       If line.Length > 0 Then
         Dim c As String = line.CharAt(0)
         If c.ToUpperCase <> c Then
           Dim si As SdkItem = ParseItem(index, lines)
           If Not(InAvailableItems And IsInstalled(si, True)) Then
             If RecommendedSet.ContainsKey(si.Key) And InAvailableItems Then
               RecommendedItems.Add(si)
             Else
               CurrentMap.Add(si)
             End If
           End If
         End If
       End If
     End If
     index(0) = index(0) + 1
   Loop
End Sub

Click on F8 to let it continue step by step. Does it reach the correct case:

?

What is printed from this line:
Log(lines(index(0) - 1))

?
 

jimmyF

Active Member
Licensed User
Longtime User
If I stop and print that line only I get this:

Then if I continue from that line the result is as follows:

 

jimmyF

Active Member
Licensed User
Longtime User
Does it go to the correct case block?

No. It goes to the bottom of the loop.
B4X:
index(0) = index(0) + 1

You can add this code after line 279:
Code:
Dim s AsString = lines(index(0) - 1)
Log("s: " & s)
Log(s.Length)
Log(s = "Installed packages:")

And I get this:

Then the error:
 

jimmyF

Active Member
Licensed User
Longtime User
Runs fine but the app log is as follows:

Actually, the file C:\Users\James.SEF2\.android\repositories.cfg does not exist in that folder
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…