用 firebase_admob 颤动
Flutter with firebase_admob
在我的项目中,当我在 pubspec.yaml 文件中添加插件 firebase_admob: ^0.7.0 时,应用程序停止工作。我的意思是说当应用程序启动时它会眨眼关闭并显示警告框说 "App keeps stopping".
在控制台中打印以下日志...
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
该应用程序也已安装但从未打开。但是当我点击它打开它时它说 ABC app keep stopping... App info or close app
我的依赖项 **pubspec.yaml
cupertino_icons: ^0.1.2
share: ^0.5.3
firebase_admob: ^0.7.0** // app stops working when added
我也已将我的 app_id 添加到 android_manifest.xml
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-XXXXXXXXXXX~XXXXXXXXXX"/>
我还在我的应用程序级别添加了以下依赖项 gradle..
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
**implementation 'com.google.android.gms:play-services-ads:17.1.1'**
}
有人遇到过这个问题>
谢谢
能够通过更改打开应用程序:`firebase_admob: ^0.5.5
和
dependencies {
api 'com.google.firebase:firebase-ads:15.0.1'
}
并使用我的 AdMob 密钥添加到 AndroidManifest.xml:
</activity>
<meta-data
android:name="com.google.android.gms.ads.APP_ID_HERE"
android:value="ca-app-pub-XXXXXXXXXXXXXXXX"/>
</application>
在我的项目中,当我在 pubspec.yaml 文件中添加插件 firebase_admob: ^0.7.0 时,应用程序停止工作。我的意思是说当应用程序启动时它会眨眼关闭并显示警告框说 "App keeps stopping".
在控制台中打印以下日志...
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
该应用程序也已安装但从未打开。但是当我点击它打开它时它说 ABC app keep stopping... App info or close app
我的依赖项 **pubspec.yaml
cupertino_icons: ^0.1.2
share: ^0.5.3
firebase_admob: ^0.7.0** // app stops working when added
我也已将我的 app_id 添加到 android_manifest.xml
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-XXXXXXXXXXX~XXXXXXXXXX"/>
我还在我的应用程序级别添加了以下依赖项 gradle..
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
**implementation 'com.google.android.gms:play-services-ads:17.1.1'**
}
有人遇到过这个问题>
谢谢
能够通过更改打开应用程序:`firebase_admob: ^0.5.5
和
dependencies {
api 'com.google.firebase:firebase-ads:15.0.1'
}
并使用我的 AdMob 密钥添加到 AndroidManifest.xml:
</activity>
<meta-data
android:name="com.google.android.gms.ads.APP_ID_HERE"
android:value="ca-app-pub-XXXXXXXXXXXXXXXX"/>
</application>