0

I have created Android lib that uses ArCore (native) (https://developers.google.com/ar/develop/c/enable-arcore), one of the requirements is to add in your gradle file a few lines

This one configurations { natives } at the top of your gradle file and these

implementation 'com.google.ar:core:1.13.0'
natives 'com.google.ar:core:1.13.0'

at the dependencies block

I have added them in my Android lib. Then I build .aar file and added it to sample project to check if it is works as expected, and I got an error in this line

CHECK(ArCoreApk_requestInstall(env, activity, user_requested_install, &install_status) == AR_SUCCESS);

In order to solve it I had to edit gradle file(add dependency above) of sample project and then it work.

Question is - why I need to add twice the same dependency under my lib gradle and my project gradle...

I thought that after I have add all required dependency in my lib I should not duplicate them also in project...

Sirop4ik
  • 4,543
  • 2
  • 54
  • 121
  • What's the error message you got? – stewe93 Nov 25 '19 at 09:20
  • @stewe93 but I wrote it in question... – Sirop4ik Nov 25 '19 at 09:23
  • You say "in this line" but this isn't an error message. Nevermind. Would you mind to try to add your ArCore devendencies with the `api` keyword instead of `implementation`? I think this would solve your issue. If it works I will answer the question if you don't mind. – stewe93 Nov 25 '19 at 11:01
  • hmm `api`, just now tried and look with usage of `api` in my sample project I don't need to write two lines as I described in question , but instead I need to write this line `api 'com.google.ar:core:1.13.0'`, I agree that it is less the two lines, but anyway question is - why I need to duplicate it (even with one line) if all of this dependency has already included in lib's gradle file... ? Or I did not get your idea? – Sirop4ik Nov 25 '19 at 11:39
  • In your own library, change the implementation to api than I think this would solve your problem – stewe93 Nov 25 '19 at 13:44
  • @stewe93 I found this answer https://stackoverflow.com/a/44419574/5709159 and have already tried to change `implementation` to `api`, but it is not helped. – Sirop4ik Nov 25 '19 at 14:17

0 Answers0