Android Question Generating R File Errors. Constraintlayout 2.0.4. Has already been defined.

Ronald Berardinis

Member
Licensed User
I am getting this strange errors that came out of nowhere?

Generating R file. Error
c:\android\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:339: error: Attribute "android:alpha" has already been defined
c:\android\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationX" has already been defined
c:\android\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationY" has already been defined
c:\android\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationZ" has already been defined
c:\android\tools\..\extras\b4a_remote\com\google\android\material\material\1.3.0\unpacked-material-1.3.0\res\layout\material_clock_period_toggle.xml:18: error: Error: No resource found that matches the given name (at 'checkedButton' with value '@id/material_clock_period_am_button').
c:\android\tools\..\extr
as\b4a_remote\com\google\android\material\material\1.3.0\unpacked-material-1.3.0\res\layout\material_timepicker_dialog.xml:82: error: Error: No resource found that matches the given name (at 'layout_constraintEnd_toStartOf' with value '@id/material_timepicker_ok_button').



One day all is great and next day error pops up about constraintLayout?
I have installed all the components labeled Constraint.
It does not make any sense that you can have a large list constraint components that all relate to the same thing ?
Why not just one Constraint library or component or whatever these installed stuff is called?
BTW, I am using B4A version 10.5



In my installed-components.txt file i see these entries and i believe it is related to the error i am getting


com.google.android.material\:material=1.3.0
androidx.constraintlayout\:constraintlayout=2.0.4

What is the solution to fix my errors so i can compile the program successfully?

Thank you for any help you can give me on this.
 

agraham

Expert
Licensed User
Longtime User
I have installed all the components labeled Constraint.
If this means you have been playing with the SDK Manager then start again with a fresh SDK installed exactly as here
and see if the problem persists.
 
Upvote 0

Ronald Berardinis

Member
Licensed User

thank you for your suggestion.
I followed directions but now have a new error

Generating R file. Error
c:\android\tools\..\extras\b4a_remote\com\google\android\material\material\1.3.0\unpacked-material-1.3.0\res\layout\material_clock_period_toggle.xml:18: error: Error: No resource found that matches the given name (at 'checkedButton' with value '@id/material_clock_period_am_button').
c:\android\tools\..\extras\b4a_remote\com\google\android\material\material\1.3.0\unpacked-material-1.3.0\res\layout\material_timepicker_dialog.xml:38: error: No resource identifier found for attribute 'barrierMargin' in package 'compuplus.abc_client'
c:\android\tools\..\extras\b4a_remote\com\google\android\material\material\1.3.0\unpacked-material-1.3.0\res\layout\material_timepicker_dialog.xml:82: error: Error: No resource found that matches the given name (at 'layout_constraintEnd_toStartOf' with value '@id/material_timepicker_ok_button').


these errors don't look like any variables in my code?

is this something in an XML file ?
 
Upvote 0

Ronald Berardinis

Member
Licensed User

How can I determine what version i downloaded.
Is there anything in a directory that can be replaced or change some ini file ?
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I'm sorry to jump on this thread, but I am also having the issue with a project I created some time ago, my customer has asked me to make some small changes but now the project will not run as I am getting the following error:

I have downloaded the command line tool and resources recommended on this link https://www.b4x.com/b4a.html and have created a new directory where I have placed those two folders but i am still seeing the same issue.

These are the libraries i am using if is of any help and i am using B4A 10.5.


Any ideas?

Walter
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Ronald Berardinis

Member
Licensed User


Like you, i did the same and downloaded the files and recreated the \Android directory as the installation instructions specified.
However, i did a second time but instead used the 7-Zip.exe to export the files.
The video on the instructions page shows a simple copy and paste using windows opening the zip files.
Instead use the 7-Zip.exe program to first save to a separate directory then copy to the \Android folder.
Strange but that got rid of the 2.0.4 issue.
then i had a reference in my program to #AdditionalJar: com.android.support:design which i commented out.
That was the cause of my 2nd problem.
Again, all worked fine with my B4A for years.
The project compiled without issues for 3 years.
Then one day, all of a sudden, i could not compile?
One of the suggested components in the SDK manger was installed that screwed my system up.
Next time i will not download unless i wait at least a month before bugs worked out.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
The issue was the constraintlayout-2.0.4 when I looked inside that folder there were two versions 2.0.4 and 1.1.3 I deleted the 2.0.4 version and left only v1.1.3 and this fixed the issue.

Thanks,
Walter
 
Upvote 0

Greg Breinholt

Member
Licensed User
Longtime User
Getting the same issue... but I don't see Version 1.1.3 (only the dreaded 2.0.4):



I guess I'll delete the SDK and start again.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…