Android Question [SOLVED]: Compile error when using XUI Views (Version: 2.41) in my app, but XUI example works

PhilN

Member
Licensed User
Longtime User
I am getting the following error:

B4A Version: 10.2
Java Version: 11
Parsing code. (0.10s)
Building folders structure. (0.05s)
Compiling code. Error
Error compiling program.
Error description: Current declaration does not match previous one.
Previous: {Type=Tasks,Rank=0, RemoteObject=False}
Current: {Type=List,Rank=0, RemoteObject=True}
Error occurred on line: 70
Dim tasks As List


The Log shows:

Unknown member: add
Unknown member: add
Unknown member: add
Unknown member: initialize
Current declaration does not match previous one.<br />Previous: {Type=Tasks,Rank=0, RemoteObject=False}<br />Current: {Type=List,Rank=0, RemoteObject=True}
Camera - 74: Object converted to String. This is probably a programming mistake. (warning #7)
Camera - 84: Object converted to String. This is probably a programming mistake. (warning #7)
CameraExClass - 382: Unused variable 'faceRect'. (warning #9)
CameraExClass - 52: Comparison of Object to other types will fail if exact types do not match.
Better to put the object on the right side of the comparison. (warning #35)
Messages - 18: Variable 'userText' is never assigned any value. (warning #10)
Messages - 47: Sub 'CreateSpeachBubble' is not used. (warning #12)
File 'status_created.png' is not used. (warning #15)
File 'status_paused.png' is not used. (warning #15)


The error only occurs when I simply include the XUI Views (Version: 2.41) library no matter whether I use any views in my code or not. As soon as I un-include the library my app compiles successfully. This is very strange behavior.
 

PhilN

Member
Licensed User
Longtime User
Looks like you have a previous declaration of a variable 'tasks' as a type called 'Tasks' and you are re-declaring as a List.
The weird thing is no where in any of my activities does ' Dim tasks As List' appear. Edit: I did previously use 'tasks as a list', but no longer. This is very odd and somehow I cannot seem to get rid of this particular error. I created a new project and copied the so called "broken" code of the activity that utilizes XUI views and pasted it into the new project main activity. It works and compiles properly. Perhaps I should recreate my project or at least the activity module that is in question.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
you probably have two libraries or classes that declare a variable with two different types.

What other library do you use?
 
Upvote 0

PhilN

Member
Licensed User
Longtime User
SOLVED: Ok. So I found the error. I had an activity module named 'Tasks' which seemed to be clashing with the XUI views library. So I renamed the activity to MyTasks and now everything works. Thanks for your advise @Erel.
 
Upvote 0
Top