Skip to content
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

Install completely fails for both iOS & Android #69

Closed
dwilt opened this issue Sep 30, 2016 · 8 comments
Closed

Install completely fails for both iOS & Android #69

dwilt opened this issue Sep 30, 2016 · 8 comments

Comments

@dwilt
Copy link

dwilt commented Sep 30, 2016

Running React Native 0.34. Followed your automatic installation steps and am getting these errors:

Android:

/Users/dwilt/Projects/GJS/gjs-app/android/app/src/main/java/com/greatjonesstreet/MainApplication.java:37: error: constructor FBSDKPackage in class FBSDKPackage cannot be applied to given types;
            new FBSDKPackage(),

screenshot 2016-09-30 13 54 39

iOS:

'FBSDKShareKit/FBSDKSharekit.h' file not found

screenshot 2016-09-30 13 53 24

I noticed that you are not including any of the Facebook SDK stuff in your manual instructions but it is being populated via the react-native link. Not sure if this is related or your documentation to manually install just needs to be updated.

@nilsreichert
Copy link

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!

@sibelius
Copy link
Collaborator

@dwilt do you still have this problem?

@franzisk
Copy link

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?

@jgcmarins
Copy link
Member

which version of react native are you using?

@franzisk
Copy link

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"
  },

@MateusAndrade
Copy link
Collaborator

MateusAndrade commented Jul 19, 2019

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

@franzisk
Copy link

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

@MateusAndrade
Copy link
Collaborator

MateusAndrade commented Jul 19, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants