FBSDKPackage in class FBSDKPackage cannot be applied to given types; CallbackManager not found #429
Comments
The error appears when I use Gradle 3 instead of Gradle 2. I've made two builds, with the same code, one using Gradle 2 and everything is ok. With Gradle 3 I've got the issue error. |
You have to pass the mCallbackManager to new FBSDKPackage () as a parameter when creating the package.
|
I was already doing it @ramosalx1504 the issue comes when using gradle 3 instead of 2 |
Please is there a solution to this yet? |
in my case there was new FBSDKPackage(mCallbackManager) & new FBSDKPackage() in myApplication.java that was causing error . i removed new FBSDKPackage() and the error is gone. |
When you do react native link — FBSDK method with no param added in 'MainApplication.java'. Replacing it with FBSDKPackage(mCallbackManager) will fix it. Make sure you have not called method twice. |
I am also using gradle 3 and the changes mentioned for android environment in the below link made it work. |
and what if i did it twice ? |
I'm also seeing this error: My MainApplication.java:
However inside
Which results in the error when I try and build:
I've searched my code and there's definitely no instances of |
It looks like Callback is not required anymore :) 321923e |
@jdnichollsc I think they are planning to remove the need of |
Adding mCallbackManager lead to error: "react-native-fbsdk": "^0.10.1" |
@iLyxa3D in 0.10.1 you should use old installation guide with extra hacks https://github.com/facebook/react-native-fbsdk/tree/82a6c9e6ef1db4633485e3793ab6a4c32bc84f63 |
In case could help anyone I managed to fix the issue by upgrading Gradle to version 4. As I said at #429 (comment) can't use Gradle 3 😕 On your
|
You can see the installation steps from the branch 0.10.0-stable |
@elatonsev @ajaykumar97 i followed the steps on the installation and it's still throwing this one
|
@darsodango Have you followed all the steps mentioned in https://github.com/facebook/react-native-fbsdk/tree/0.10.0-stable? I mean, In
|
@ajaykumar97 yes i followed those steps. btw, what is your react-native version? mine is |
@darsodango Mine react-native version is |
There isn't loads of time to wait as the deadline to get apps upgraded to Android X (0.60.0) is August and I'm getting started now - any solutions besides reverting to 0.59.10 or waiting for a new react-native-fbsdk version? |
If you're using 0.60.0, you can disable auto-linking by creating a module.exports = {
dependencies: {
'react-native-fbsdk': {
platforms: {
android: null,
ios: null,
}
}
}
}; |
@dpwilhelmsen I tried your solution but could not successfully install |
@dancherb One solution could be just create a new project with |
I ended up using the latest RC version, which doesn't require manual linking or the callback manager to be passed in, and all good
…---- On Sun, 14 Jul 2019 15:31:41 +0200 notifications@github.com wrote ----
@dancherb One solution could be just create a new project with react-native 0.59.10. Install all of your current dependencies in the newly created project and Copy your JS code into the new project.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Is there any solution to get rid of PackageList.java error. I am stucking here for 1day. I dont want revert to 0.59.10 at all.. |
i m using react-native version 0.59.10 and i m stuck in this error too ? what should i do ? |
As per his command |
@darsodango pls uninstall react-native-fbsdk and install ''yarn add git+https://github.com/facebook/react-native-fbsdk.git". It worked for me |
fix for me @vnanhtuan so the npm of this lib is still outdated, right? |
Same issue here with RN0.6 with autolinking... (new project from scratch)
|
Hi Team, Currently i am using react-native 0.60.0 version. I have followed below steps,
I am getting following error:
My MainApplication.java looks differently not like above comment. MainApplication.java package com.knowledgeupdateapp; import android.app.Application; import com.facebook.react.PackageList; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
}; @OverRide @OverRide
|
in the root of you project create a file react-native.config.js then module.exports = { finally run-android |
Thanks @michelmouallem |
@dancherb when you say "latest RC version", do you mean of react native or react-native-fbsdk ? And which version if the latest RC |
@chrisflora You can use "react-native-fbsdk": "^1.0.0-rc.4" |
thanks, @michelmouallem . It works |
@michelmouallem unfortunately didn't work with me and still gave me same error |
I have tried all these solutions and still facing same error . Can anybody help with that ? |
try to use the latest version of react-native-fbsdk@1.0.1 or via "react-native-fbsdk": "git+https://github.com/facebook/react-native-fbsdk.git" In MainActivity.java add In Mainapplication.java add the line to getpackages import com.facebook.CallbackManager; @OverRide
It should works |
@michelmouallem this is my current Mainapplication.java getPackages() and still didn't work @OverRide and I am using latest version of FBSDK |
which version of reactnative are you using ? your mainapplication.java should be as below in case you are using an oldest version of react <0.6.0 so it is mandatory to add react-native-fbsdk@0.9.0 for react-native >0.6.0 it is mandatory to use FBSDK v5 in addition |
@MayarAhmed Code shows you are using an old version of React Native( < 0.60). as the new version has a separate package list class. Can you please share the screenshot or the error logs so that we can look into it. I think the solution that @michelmouallem has provided is for the latest React Native (>0.60). If you have no problem to update you React Native version (>0.60) then you can see React Native Facebook Integration Example using Facebook SDK |
Version i used: After that i migrated to AndroidX by, Deleted nodemodules and installed again and run this command npx jetify. This error disappeared after that. |
@michelmouallem SnehalAgrawal Thanks it worked now it was a difference of versions :) |
@MayarAhmed Happy to know that. :) |
@michelmouallem hello, is there any progress on react native >= 0.60 ? Iam still getting the same callback error and i have tried everything above. Even the react-native.config.js which doenst solve the problem. EDIT: I have found solution!! Using the stable version |
Versions: To overcome this problem, disable auto-linking for react-native-fbsdk package by editing react-native.config.js file like : After that, It will use your declared instance with callback in MainApplication.java . |
|
For react-native version >=0.60.0, use react-native-fbsdk@ 1.0.2. It solved my problem of callbackManager. |
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 8.11.2
Yarn: 1.10.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.1 AI-173.4819257
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
Description
Recently, while updating react-native-fbsdk from 0.7.0 to 0.8.0. When I try to build the app I've got the following error:
The pointed line, does not contains the code that is highlighting 😕
However, I couldn't find any code that matches the error, on the
MainApplication.java
the new FBSDKPackage is called with the callback manager as stated in the docs:The text was updated successfully, but these errors were encountered: