Android Question Java Compile error

DavidTheGeek

Member
Licensed User
Longtime User
Hello

I have returned to B4A after a gap of about a year, and called up a project which previously worked. Now I can't get it to build. It faisl with this error:

Compiling debugger engine code. (4.48s)
Compiling generated Java code. Error
gen\ubr\stockchecker\R.java:462: error: ';' expected
public static final int foreground _ Copy=0x7f090002;
^
1 error

javac 11.0.1


I tried on a fresh install and got the same issue:

Compiling debugger engine code. (6.66s)
Compiling generated Java code. Error
gen\ubr\stockchecker\R.java:266: error: ';' expected
public static final int foreground _ Copy=0x7f080002;
^
1 error
only showing the first 1 errors, of 2 total; use -Xmaxerrs if you would like to see more

javac 22

Is there something I should have changed?
 

Daestrum

Expert
Licensed User
Longtime User
My friend 'CoPilot' says you have a space in the variable name.
foreground _ Copy = foreground_[SPACE]Copy
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Maybe there's a typo in a Library you are using.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Is there something I should have changed?
maybe the underlying SDK. It has changed some months ago.

Delete B4A AND the sdk.
Install them new based on the installationinstructions.
 
Upvote 0

DavidTheGeek

Member
Licensed User
Longtime User
maybe the underlying SDK. It has changed some months ago.

Delete B4A AND the sdk.
Install them new based on the installationinstructions.
Thanks, but I did that about an hour ago on a new machine when the error occurred on the old one.

I found reference to a png called foreground[space]-[space]copy. I'll chase that down.

Thank you both for the speedy help!
 
Upvote 0

DavidTheGeek

Member
Licensed User
Longtime User
So then I go a lot more errors....I decided to start a new project, and now the error is

B4A Version: 12.80
Parsing code. (0.03s)
Java Version: 8
Building folders structure. (0.42s)
Running custom action. (0.05s)
Compiling code. (0.49s)
Compiling layouts code. (0.06s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (0.10s)
Linking resources (0.30s)
Compiling debugger engine code. Error
B4A line: 11
Private activity As Activity
shell\src\b4a\tester\b4xmainpage_subs_0.java:58: error: cannot find symbol
b4xmainpage._activity = RemoteObject.createNew ("anywheresoftware.b4a.objects.ActivityWrapper");__ref.setField("_activity",b4xmainpage._activity);
^
symbol: variable _activity
location: class b4xmainpage
1 error
only showing the first 1 errors, of 2 total; use -Xmaxerrs if you would like to see more

".b4xmainpage._activity" is, I assume, generated by B4A but I can't see it:

#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region

'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip

Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private activity As Activity
Private Button1 As B4XView
End Sub

Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("main")
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
 
Upvote 0
Top