Android Question problems after B4a & SDK update

mbatgr

Active Member
Licensed User
Longtime User
A week ago i was working on B4a without any problem. After update with the new version of B4a and SDK java files, I get several unexplained errors (on my PC and my Laptop too).

1. In a sudden, I get the message during compliling
"Can't find the file:
Configure paths Tools etc

I did look at the forum and do some recommendations that did not work (define system variable c:\andoid/android-sdk/data/platform-tools" etc)

2. In a machine that the compiling was finishing without problem (I have 3 machines) , sometimes I get the message "An error occur. Rapid debugger failed to connect to device. Pleae try again" (I have a Nexus 7 II). Trying again, get an error on tablet's screen "Unfortunately, the app xxxxxx, has finished unexpectably" at the very and then on Pc screen "An error occur. Rapid debugger failed to connect to device. Pleae try again"... sometimes when I close the B4a and re-open it, it works...

3. The most worryined problem is that in cases that I finally do the compliling properly and the program run on my tablet, there is a label view which its text updated properly with a new text message but this is not shown on my tablet screen (showing the text before the new "updated" text), I found it using breakpoints and delibarately set the label.text with a new text-.

4. Another worried problem ( I solved anyway by changing the code but strange for me though) is that there was a text view which when I was attemping to add its content to a list view, list.add(textview.text), the programm crashed getting long red messages something about "do you load layout etc" (but the text view was created on the designer so no need to be initiliased).

As a result I'm totally unable to continue programming my B4A little app.

regards
mike
 

KMatle

Expert
Licensed User
Longtime User
1. Which file(s)? Is it zip.align?

2: "Bad code" has a strong effect to the debugger and other components. This is not a b4a thing. Please check the logs (uncheck "filter").

3.-4.: For sure you have made a programming mistake. Can you upload your code?

Generally: B4A runs ABSOLUTE stable. I have never experienced a strange behaviour (except my coding was incorrect).
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
Regarding the 1.

Parsing code. 0.12
Compiling code. 0.38
Using existing AndroidManifest.xml.
(Project - Do Not Overwrite Manifest option is checked)
AndroidManifest-Example.xml file will be created instead.
Compiling layouts code. 0.08
Generating R file. 0.24
Compiling debugger engine code. 1.30
Compiling generated Java code. 1.18
Convert byte code - optimized dex. 1.43
Packaging files. 0.28
Copying libraries resources 0.02
Signing package file (debug key). 0.66
ZipAlign file. Error
Cannot find:
Please configure paths (Tools - Configure Paths).
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
The app is working in cooperation with a server, so it would be difficult for you to see it running. It has a main activity, the editbox code and the scale code plus ClsWheelSimple class. I thing that the app is trubling me after adding and modifying it in order to work with a speedwheel just to store the working IP's in a list box. if you can find out the bug just seeing the code, I would be glad to upload it to your mail to have a look.
regards
mike
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
I think the problem is not that big. Could you post the declarations of the list ("Dim List as ...", "List.Initialize(....)", List.add... and the definition of what you want to store in the list.

Could you post the full error message?

Did you get b4a up again?
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
Yes, I reinstall the SDK in all of my machines and copy the files, thank you Klaus
I will be off for some hours but then after 9pp I will be able to send you those code.
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
The class I use is the code of ClsWheelSimple3 (CWS3) but having 3 buttons instead of 2

1 (“Get IP” correspond to button OK of the CWS3 example

2 (“INSERT” which the control is vanished and the user should enter an IP on txtServerIP text view)

3 (“RESET” correspond to button Cancel of the CWS3 example (the file is deleted and re-creates one with 1 entry, that is the IP highligthed of the Wheel and the app ended



Clicking on 1 button of the CWS3 class, fires the CallClsWheel_btnOK of MAIN activ

Clicking on 2 button of the CWS3 class, fires the CallClsWheel_btnCancel of MAIN

Clicking on 3 button of the CWS3 class, fires the CallClsWheel_btnRESET of MAIN
 
Last edited:
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
I think that this code is the modified good code. I will look later on my pc to find the defected one with the many red line errors and I will copy them to you
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
this is part of the code

B4X:
Sub ReadTextReader    
   
    Dim TextRd As TextReader    
    Dim a As String
    a=File.Exists("", File.DirDefaultExternal & "/" & "IBRT_IPs.txt")
    If a Then
        TextRd.Initialize(File.OpenInput(File.DirDefaultExternal, "IBRT_IPs.txt"))  
       lstData.Clear
       Dim line As String    
       line = TextRd.ReadLine        
       Do While line <> Null    
           lstData.Add(line)        
           line = TextRd.ReadLine    
       Loop    
       TextRd .Close
        IBRT_IPfile_EXIST=True
    Else
        Dim lstData As List
        lstData.initialize
        lstData.Add (txtServerIp.text) <------------------------------------line 1083
        File.WriteList(File.DirDefaultExternal, "IBRT_IPs.txt", lstData)
    End If
End Sub
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
Copying updated assets files (17)


** Activity (main) Create, isFirst = true **


Error occurred on line: 1083 (main)
java.lang.RuntimeException: Object should first be initialized (EditText).


Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:46)
at anywheresoftware.b4a.objects.TextViewWrapper.getText(TextViewWrapper.java:31)
at Mike.Batakis.IBRT_client.main._readtextreader(main.java:2242)
at Mike.Batakis.IBRT_client.main._initdatewheel(main.java:575)
at Mike.Batakis.IBRT_client.main._activity_create(main.java:389)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:305)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at Mike.Batakis.IBRT_client.main.afterFirstLayout(main.java:98)
at Mike.Batakis.IBRT_client.main.access$100(main.java:16)
at Mike.Batakis.IBRT_client.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
Thanks for the recomemndation. I finally solved the problem yesterday, I start the project from the point where is was working before add the speedwhell. Then step by step I added the cextra code...It seems that the problem solved when I declare tyhe related variable on Globals instead of Process Globals...
 
Upvote 0
Top