Android Question Error when compiling with .arr library: "No resource found that matches the given name"

abilio486software

Active Member
Licensed User
Hello,

My project is almost without errors but some persist

Can you help me to avoid this errors?
B4X:
B4A Version: 10.60
Parsing code.    (0.00s)
    Java Version: 8
Building folders structure.    (0.02s)
Compiling code.    (0.03s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.02s)
    (AndroidX SDK)
Generating R file.    Error
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\full_train_row.xml:9: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/full_train_row_start_button').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\main_fragment_layout.xml:21: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/main_accessibility_switch').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\main_fragment_layout.xml:26: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/main_accessibility_switch').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\main_fragment_layout.xml:40: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/main_assistance_switch').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\main_fragment_layout.xml:46: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/main_assistance_switch').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\main_fragment_layout.xml:63: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/main_color_selection_toggle').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\main_fragment_layout.xml:68: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/main_color_selection_toggle').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\main_fragment_layout.xml:86: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/main_total_amount_toggle').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\main_fragment_layout.xml:91: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/main_total_amount_toggle').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\psdk_device_information_row.xml:28: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/psdk_device_info_value').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\psdk_display_configuration_fragment.xml:13: error: Error: No resource found that matches the given name (at 'layout_constraintTop_toBottomOf' with value '@id/psdk_configuration_recycler_view').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\psdk_display_configuration_fragment.xml:33: error: Error: No resource found that matches the given name (at 'layout_constraintEnd_toStartOf' with value '@id/psdk_switch_usb').
C:\Android\tools\..\extras\b4a_local\unpacked-paymentsdk-3.33.0.androidx-63749702722441\res\layout\training_fragment_layout.xml:45: error: Error: No resource found that matches the given name (at 'layout_toStartOf' with value '@id/short_train_row_start_button').

Library: .aar
 

Attachments

  • verifone_using_aar.zip
    10.2 KB · Views: 229

makis_best

Well-Known Member
Licensed User
Longtime User
Before that... let me ask... have you jetify your libraries?
Maybe at your Manifest editor you have a library no need to be there.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
the compiler is looking for that .aar where your SDK is located. it shouldn't be doing that, and the .aar shouldn't be there in any case. i'm sorry, but i'd rather not look at the project; i know you've been working hard at it for some time. i'm sure our leader erel will spot your post tomorrow morning...
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
i'm sorry no one else has picked up on your post. the compiler is looking for a number of resources within that .aar. and if you look at the .aar, you can see they are there.

your .aar seems to contain an entire system (code plus graphic views - buttons, etc). my experience with .aar's has been limited to sucking out code only. in other words, i would use my own views, if needed. you may actually have more than just a library... i think - just a thought - that you need a way of including the .aar's "res" folder in your app. i've seen it done in b4a eg, here

it's like "#AdditionalJar", only with "#AdditionalRes".

if the classes.jar within the .aar did not refer to these resources, i think you could compile and simply refer to classes.jar (possibly desugared). but if classes.jar depends on these resources, then you have a problem unless you can manually add them to the app. it appears the compiler does not see them in the res folder. whether the compiler is supposed to see them, i don't know. whatever - it doesn't.

there is also the possibility you went about wrapping the library incorrectly. once wrapped correctly, i would think everything would be visible to the compiler. especially since the "missing" resources are there. the little example you attached, doesn't indicate how you access the system.

maybe this helps you some.
 
Upvote 0

abilio486software

Active Member
Licensed User
i'm sorry no one else has picked up on your post. the compiler is looking for a number of resources within that .aar. and if you look at the .aar, you can see they are there.

your .aar seems to contain an entire system (code plus graphic views - buttons, etc). my experience with .aar's has been limited to sucking out code only. in other words, i would use my own views, if needed. you may actually have more than just a library... i think - just a thought - that you need a way of including the .aar's "res" folder in your app. i've seen it done in b4a eg, here

it's like "#AdditionalJar", only with "#AdditionalRes".

if the classes.jar within the .aar did not refer to these resources, i think you could compile and simply refer to classes.jar (possibly desugared). but if classes.jar depends on these resources, then you have a problem unless you can manually add them to the app. it appears the compiler does not see them in the res folder. whether the compiler is supposed to see them, i don't know. whatever - it doesn't.

there is also the possibility you went about wrapping the library incorrectly. once wrapped correctly, i would think everything would be visible to the compiler. especially since the "missing" resources are there. the little example you attached, doesn't indicate how you access the system.

maybe this helps you some.

Many thanks for your help, I will try to extract your recommendation and put the required resources, that are inside de .aar, also on an #AditionalRes. I will return to you with feedback ?
 
Upvote 0

abilio486software

Active Member
Licensed User
i'm sorry no one else has picked up on your post. the compiler is looking for a number of resources within that .aar. and if you look at the .aar, you can see they are there.

your .aar seems to contain an entire system (code plus graphic views - buttons, etc). my experience with .aar's has been limited to sucking out code only. in other words, i would use my own views, if needed. you may actually have more than just a library... i think - just a thought - that you need a way of including the .aar's "res" folder in your app. i've seen it done in b4a eg, here

it's like "#AdditionalJar", only with "#AdditionalRes".

if the classes.jar within the .aar did not refer to these resources, i think you could compile and simply refer to classes.jar (possibly desugared). but if classes.jar depends on these resources, then you have a problem unless you can manually add them to the app. it appears the compiler does not see them in the res folder. whether the compiler is supposed to see them, i don't know. whatever - it doesn't.

there is also the possibility you went about wrapping the library incorrectly. once wrapped correctly, i would think everything would be visible to the compiler. especially since the "missing" resources are there. the little example you attached, doesn't indicate how you access the system.

maybe this helps you some.

Many thanks, your help was very important.

I had extract the res missing and change the files, folowing reported errors, exchanging entries from "@id/aaa..." to "@+id/aaa...", and now compiled without resources errors, but I insert a new thread with a sequent error:
 
Upvote 0
Top