-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not find a package configuration file provided by "fbjni" #50
Comments
cc @passy |
Having the same issue :/ Anyone? @passy ? |
might be related to facebook/flipper#1968 |
Reporting errors is not always actionable. If a sample project could be shared that'd be great |
this should reproduce https://github.com/karol-bisztyga/rnfbjni |
I checked with RN 0.64.0-rc.4 and I got the same error. |
You may need to enable |
Thanks for that! I'm playing around with this right now. |
After adding
I got this error: I'm pretty sure the cmake's location is right, and before adding the Don't know if this error is related to this issue, though. |
So in general everything would work fine here if you did this:
However, because there are more dependencies on React Native as part of your npm libraries, you will still pull in That's a limitation of the Android build system. You cannot use prefab and non-prefab versions of the same library in one application. If you want to use |
I got this building(I pushed the commit to my repo) more or less doing the same as you, that does not mean I got this fully working as I don't have a code using fbjni but I'll try to push something like that, thx anyway. I for sure will leave the repo with the commits 'before' and 'after' for anyone having similar problems 🙌 Also please, don't close this issue for now, I'd like to make sure this works and write down some thoughts etc(I know we overcame this particular problem and we could close this and open a new one, but I see you guys don't have a lot of issues here so maybe we can deal with anything on the way in this one?). |
Direct link to the commit you referenced: karol-bisztyga/rnfbjni@dfbdb2a |
@passy, I create a pure native project https://github.com/psionic12/fbjni_demo, it has nothing to do with React Native, just trying to use fbjni. In this case, when using |
Ok, so it is working with fbjni. Once again thanks for the help! After you mentioned
This still gives me errors about duplicate classes(I'm referring to the code from the commit I pasted above). |
The error message isn't great but by telling you
it's saying that you need to target a shared C++ runtime. If you add this to your project, it builds:
|
I'm definitely open to suggestions here. Sadly the universe of potential Gradle errors is nearly infinite and depends so much on what you are trying to build. If you just google for "duplicate classes gradle" you'll find an endless stream of cases. We can't really anticipate every one of them here, but if there's a particular advice we can give, I'd love to add that to the docs. |
I know you said that there are a lot of options but I'd like to refer to this particular example.
throws
Do you think this is related to my config or local env? Could it possibly be related to the fbjni itself? |
it turned out that replacing
in following packages(in
does the job. But I don't think it's a good way to be honest, because in different app you'd have different packages installed, going through all of them is not quite efficient, right? Also, some things might stop working in certain libraries. At the same time, those packages mentioned above are pretty common for an RN app, aren't they? |
I think I got this working by adding
I'm not sure yet whether this is a perfect approach, but it builds after cleaning as well as afterward. Changes on my repo. |
@karol-bisztyga your repo was very helpful in the understanding of how to create C++ native module. |
@prakashjais99 hi, actually I was recently doing some research about JSI native modules and published a repo with step-by-step demo. I got inspired i.a. by this issue and the repo above. |
Adding jcenter() under allprojects in build.gradle worked for me |
This works for me too! |
I'm getting this failure message My dependencies are as below:
|
very simple go to build.gradle of project and change enablHermes true -> false..... |
Just extend android/grafle.properties by adding: android.prefabVersion=2.0.0 |
I fixed it by adding this to my module build.gradle android {
...
defaultConfig {
...
externalNativeBuild {
cmake {
...
arguments "-DANDROID_STL=c++_shared"
}
}
}
} |
Issue description
Created a brand new ndk project, CMake reported an error:
Code example
System Info
CMake version: 3.10.2
Gradle Plugin version: 4.1.2
Gradle version: 6.5
The text was updated successfully, but these errors were encountered: