Giter Club home page Giter Club logo

Comments (8)

nilsreichert avatar nilsreichert commented on May 26, 2024 3

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.

MateusAndrade avatar MateusAndrade commented on May 26, 2024 1

@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.

sibelius avatar sibelius commented on May 26, 2024

@dwilt do you still have this problem?

from react-native-share.

franzisk avatar franzisk commented on May 26, 2024

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.

jgcmarins avatar jgcmarins commented on May 26, 2024

which version of react native are you using?

from react-native-share.

franzisk avatar franzisk commented on May 26, 2024

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.

MateusAndrade avatar MateusAndrade commented on May 26, 2024

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.

franzisk avatar franzisk commented on May 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.