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

Can not build after install react-native-fbsdk #13259

Closed
llioor opened this issue Apr 2, 2017 · 7 comments
Closed

Can not build after install react-native-fbsdk #13259

llioor opened this issue Apr 2, 2017 · 7 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@llioor
Copy link

llioor commented Apr 2, 2017

Description

I'm trying to install react-native-fbsdk in my react-native project.
I'm doing it with these commends:

react-native init myapp
cd myapp
npm i -S react-native-fbsdk // react-native install react-native-fbsdk is not a valid commend
react-native link react-native-fbsdk

Then I'm trying to build with this commend:
react-native run-android

Then I went through the whole installation process of "importing and overriding" which explained here:
https://github.com/facebook/react-native-fbsdk

Then I got this error during the building process:

Loading dependency graph, done.
 ERROR  EPERM: operation not permitted, lstat 'C:\wamp\www\myapp\app\android\ap
p\build\intermediates\incremental\mergeDebugResources\merged.dir\values'
{"errno":-4048,"code":"EPERM","syscall":"lstat","path":"C:\\wamp\\www\\myapp\\a
pp\\android\\app\\build\\intermediates\\incremental\\mergeDebugResources\\merged
.dir\\values"}
Error: EPERM: operation not permitted, lstat 'C:\wamp\www\myapp\app\android\app
\build\intermediates\incremental\mergeDebugResources\merged.dir\values'
    at Error (native)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
Press any key to continue . . .

I went through the steps few times with few new projects and it always happen. Moreover the doc looks a bit not updated.

Any help please in order to complete the build process without any errors?
Thanks.

@hramos hramos closed this as completed Apr 3, 2017
@llioor
Copy link
Author

llioor commented Apr 3, 2017

Hey @hramos
Can you advice? I spoke with fackbook supports and they direct me to react-native page.
My node version is 6.10.1
npm 3.10.10
react-native-cli 2.0.1

@hramos
Copy link
Contributor

hramos commented Apr 3, 2017

It looks like your description is missing some necessary information. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.

@llioor
Copy link
Author

llioor commented Apr 4, 2017

@hramos You are totally right! Sorry for that!
I edited my question and now I hope it is ok, if no please let me know what is missing.

Thank you in advance

@llioor
Copy link
Author

llioor commented Apr 4, 2017

@hramos These are my files:

MainActivity.java

package com.app;

import com.facebook.react.ReactActivity;
import android.content.Intent;

public class MainActivity extends ReactActivity {

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        MainApplication.getCallbackManager().onActivityResult(requestCode, resultCode, data);
    }

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "app";
    }
}

MainApplication.java

package com.app;

import android.app.Application;

import com.facebook.react.ReactApplication;

import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.appevents.AppEventsLogger;

import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;



import java.util.Arrays;
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() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new FBSDKPackage(mCallbackManager)
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    FacebookSdk.sdkInitialize(getApplicationContext());
    // If you want to use AppEventsLogger to log events.
    AppEventsLogger.activateApp(this);
    SoLoader.init(this, /* native exopackage */ false);
  }
}

string.xml

<resources>
    <string name="app_name">app</string>
    <string name="facebook_app_id">180127865836302</string>
</resources>

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.app"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="22" />

    <application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

@llioor
Copy link
Author

llioor commented Apr 4, 2017

Problem solved:
http://stackoverflow.com/a/43217182/2862728

@itachi0310
Copy link

Hi
Problem solved: in terminal add
rnpm link react-native-fbsdk

@RishabhMaheshwary
Copy link

RishabhMaheshwary commented Feb 12, 2018

Getting this error after following the steps at : https://github.com/facebook/react-native-fbsdk

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants