Comments (8)
I recently ran into the same error. What fixed it for me was going into {project_root}/node_modules/react-native-fbsdk and following the instructions in README.md. I hope this helps!
from react-native-share.
@franzisk since you are using the last version from react-native, the current version of react-native-share on master is targeting "react-native": "0.59.9". But on this PR, @oleksandr-dziuban added the support for both android-x and react-native 0.60.3.
What i have suggested is to you give a try in this PR and let us know if it worked for you. If you still having any problems after that, please let us know.
Also, testing this PR on a "real" project will let us know that this is working fine. 😃
from react-native-share.
@dwilt do you still have this problem?
from react-native-share.
Sorry for reopening this guys but I have a similar problem, in my base the PackageList.java being generated is being created with wrong code.
Opening the project in Android Studio I can see the problem.
How to solve this?
Android Studio Project Image
My MainApplication.java file is correct (I think):
import android.app.Application;
import android.util.Log;
import com.facebook.react.PackageList;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.ReactApplication;
import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.auth.RNFirebaseAuthPackage; // added manually
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
// Facebook SDK
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsLogger;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private static CallbackManager mCallbackManager = CallbackManager.Factory.create();
protected static CallbackManager getCallbackManager() {
return mCallbackManager;
}
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new RNFirebaseAuthPackage()); // Add the Firebase Auth Package
packages.add(new FBSDKPackage(mCallbackManager)); // Register Facebook sdk package
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
AppEventsLogger.activateApp(this);
}
}
When I run: react-native run-android
I get:
> Task :app:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
35 actionable tasks: 3 executed, 32 up-to-date
PROJECT_FOLDER/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:53: error: constructor FBSDKPackage in class FBSDKPackage cannot be applied to given types;
new FBSDKPackage(),
^
required: CallbackManager
found: no arguments
reason: actual and formal argument lists differ in length
What can I do to fix this?
from react-native-share.
which version of react native are you using?
from react-native-share.
which version of react native are you using?
"dependencies": {
"react": "16.8.6",
"react-native": "0.60.3",
"react-native-fbsdk": "^0.10.1",
"react-native-firebase": "^5.5.5"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/runtime": "^7.5.5",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.8.0",
"eslint": "^6.0.1",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.55.0",
"react-test-renderer": "16.8.6"
},
from react-native-share.
You can give a try with this PR: #550.
We need to test It before merging this, we would appreciate If you give a look on this on your project @franzisk
from react-native-share.
@MateusAndrade I don't see how that post can help me, sorry.
What do mean by "have a look on your project"? Have a look on what exactly?
from react-native-share.
Related Issues (20)
- Exclude own (Ios) app from sharesheet? HOT 2
- canOpenURL reports wrong value for ig stories url HOT 3
- Exclude own (Ios) app from sharesheet? HOT 1
- Share.shareSingle not working HOT 4
- URL icons don't work at all HOT 2
- Share didn't seem work if device has the Instagram Lite app, does this package support? HOT 1
- Image not sharing to WhatsApp HOT 4
- Permission issue at AndroidTV 10 HOT 1
- Cant send video to whatsapp HOT 2
- The File Format not supported Error HOT 2
- shareSingle does not work with multiple emails on iOS HOT 1
- root path security issue HOT 2
- Black screen on iOS when Share.open and then choosing Instagram story on iOS HOT 15
- when sharing a video to whatsapp a message is required on iOS, but not in types HOT 2
- Share menu suggestion applications are missing HOT 1
- Sending a URL along with a message does not work on IOS, only on Android. HOT 5
- [windows] LINK : fatal error LNK1104: cannot open file 'hermes.lib' HOT 1
- [Android] Sharing via LinkedIn opens play store link instead of application HOT 1
- playing music get stopped when call Share.open() HOT 1
- [Android] shareSingle opens Play Store instead of the installed app (WhatsApp) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-share.