简体   繁体   English

添加 Facebook 依赖项会导致 React Native 出错

[英]Adding Facebook dependency gives error in React Native

I am trying to add Facebook Authentication to a React Native Application.我正在尝试将 Facebook 身份验证添加到 React Native 应用程序。

  1. When I add implementation 'com.facebook.android:facebook-android-sdk:latest.release' to the Gradle Scripts | build.gradle (Module: app)当我将implementation 'com.facebook.android:facebook-android-sdk:latest.release'添加到Gradle Scripts | build.gradle (Module: app) Gradle Scripts | build.gradle (Module: app) in the dependencies , Gradle Scripts | build.gradle (Module: app)dependencies ,

  2. I get a build error as:-我收到一个构建错误:-

    Error: android:exported needs to be explicitly specified for.错误:android:需要明确指定导出。 Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined.针对 Android 12 及更高版本的应用需要为android:exported指定一个明确的值,当相应的组件定义了一个 Intent 过滤器时。 See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.有关详细信息,请参阅 https://developer.android.com/guide/topics/manifest/activity-element#exported。

This is the portion of code it is probably referring to, which already has an android:exported这是它可能引用的代码部分,它已经有一个android:exported

<application
  android:name=".MainApplication"
  android:label="@string/app_name"
  
  android:icon="@mipmap/ic_launcher"
  android:roundIcon="@mipmap/ic_launcher_round"
  android:allowBackup="false"
  android:usesCleartextTraffic="true"
  android:theme="@style/AppTheme">
 <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
 <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
    android:launchMode="singleTask"
    android:windowSoftInputMode="adjustResize"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>

</application>

This is the portion in the build.gradle这是 build.gradle 中的部分

//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"  // From node_modules

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

implementation 'com.facebook.android:facebook-android-sdk:latest.release'

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
    exclude group:'com.facebook.fbjni'
}

` `

FB broke this in their latest release. FB 在他们的最新版本中打破了这一点。

Change your import to将导入更改为

implementation 'com.facebook.android:facebook-android-sdk:14.1.1'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Native:facebook-android-sdk依赖关系构建错误 - React Native: facebook-android-sdk dependency build error React Native for Android中的依赖性错误 - Dependency error in React Native for Android 添加房间依赖性会产生清单合并错误 - adding room dependency gives manifest merge error 添加Uber依赖关系会给我的应用带来错误 - Adding Uber Dependency gives error to my app 在使用react-native添加依赖项时出错 - Errors adding dependency with react-native 错误:添加Facebook依赖项时出现版本错误 - Error: Version Error while adding facebook dependency 在Android中添加singalr依赖关系会导致库依赖关系错误 - Adding singalr Dependency in android gives library dependency error 在 Android 中添加 Facebook 登录依赖项后出错 - Error after adding Facebook login dependency in Android Axios POST 请求在 React Native 中将图像添加到 FormData 结构时给出“网络错误” - Axios POST request gives a “Network Error” when adding image to FormData structure in React Native React Native Android 给出了关于 gradle 的错误 - React native Android gives error about gradle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM