[英]Adding Facebook dependency gives error in React Native
I am trying to add Facebook Authentication to a React Native Application.我正在尝试将 Facebook 身份验证添加到 React Native 应用程序。
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
,
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.