android - 在flutter项目中添加Facebook登录后出现“请配置Android SDK”错误
问题描述
我正在开发一个使用 firebase 和 Facebook 登录的颤振应用程序。
添加 firebase 身份验证后,我的应用程序运行良好。但是在我添加 Facebook 登录后,我无法再构建该项目。控制台显示“已完成错误:Gradle 任务 assembleDebug 失败,退出代码为 1”。
当我检查 logcat 时,它告诉我“请配置 android SDK”。
当我点击它时,下图显示了 android sdk 配置
这是我的AndroidManifest.xml
package="com.example.flutter_bloc_test_project">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutter_bloc_test_project"
android:icon="@mipmap/ic_launcher">
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
我试过像降级gradle版本这样的方法。但是firebase不适用于低版本,这就是我必须首先升级的原因。
请帮忙
解决方案
推荐阅读
- angular - Angular 6/7 辅助出口按路线导航 - 清除主出口,它不应该
- javascript - 在“Fri May 10 2019 00:00:00 GMT+0800”中添加一天,并使用 JavaScript 以相同格式获得最终答案
- javascript - 在字符串中查找最长的单词不起作用
- c# - Serilog 文件接收器未记录到文件
- python-3.x - 进入点后进入容器提示的命令
- javascript - 如何在 Selenium 的会话中正确添加 Cookie?(使用节点 JS)
- aiohttp - 在 aiohttp Web 服务器中使用 ClientSession 的正确方法是什么?
- git - Git pre-receive hook 自动运行单元测试被推送到当前 ref
- javascript - 如何导入“import {authConfig} from '../configs/auth';” 在 NightWatch.js(数据驱动)中
- iphone - 从 Xcode 成功构建的应用程序,创建的 .ipa 文件已安装但未启动