我的应用程序崩溃是因为Firebase Admob依赖关系扑朔迷离 [英] my app crashes because firebase admob dependency flutter
本文介绍了我的应用程序崩溃是因为Firebase Admob依赖关系扑朔迷离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在按照此处的说明进行操作: https://pub.dartlang .org/packages/firebase_admob#-readme-tab- ,但事实是,每当我添加并且仅添加行firebase_admob:^ 0.8.0 + 3时,它就会崩溃.它只是眨眨眼然后死去.
I am following the instructions from here: https://pub.dartlang.org/packages/firebase_admob#-readme-tab- but the thing is that whenever I add and only add line firebase_admob: ^0.8.0+3 then it crashes. It just blinks open and dies.
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
cloud_firestore: ^0.9.13+1
dependencies: ^0.1.5 # this was test if app crash on dependencies and seems not.
#firebase_admob: ^0.8.0+3
#admob_flutter: ^0.1.2
flutter:
sdk: flutter
# firebase_core: ^0.2.5 # add dependency for Firebase Core
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
有人有同样的问题吗?有人可以帮助我吗?
Does someone have the same problem or can someone help me with this?
推荐答案
更新AndroidManifest.xml中的ADMOB APPLICATION_ID元数据
Update ADMOB APPLICATION_ID meta-data in AndroidManifest.xml
<application android:name="io.flutter.app.FlutterApplication" android:label="firebase_admob_example" android:icon="@mipmap/ic_launcher">
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
<activity android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
这篇关于我的应用程序崩溃是因为Firebase Admob依赖关系扑朔迷离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文