
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
에뮬레이터와 에드몹이 호환되지 않는 것 같습니다.
커뮤니티에 비슷한 질문들이 많아서 그거 보고 취할 수 있는 조치는 다 취해본 것 같은데 해결되지 않았네요 ㅠㅠ
api는 29인데도 불구하고 flutter run을 terminal에 입력해도 잘 작동이 되지 않습니다.....
PS C:\Users\yeoluna\flutter\mymemo_admob> flutter run
Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts,
consider enabling software rendering with "--enable-software-rendering".
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Building with Flutter multidex support enabled.
Running Gradle task 'assembleDebug'... 3.5s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
E/AndroidRuntime(26196): FATAL EXCEPTION: main
E/AndroidRuntime(26196): Process: com.example.mymemo_admob, PID: 26196
E/AndroidRuntime(26196): java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
E/AndroidRuntime(26196):
E/AndroidRuntime(26196): ******************************************************************************
E/AndroidRuntime(26196): * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
E/AndroidRuntime(26196): * should follow the instructions here:
*
E/AndroidRuntime(26196): * https://googlemobileadssdk.page.link/admob-android-update-manifest ;*
E/AndroidRuntime(26196): * to add a valid App ID inside the AndroidManifest.
*
E/AndroidRuntime(26196): * Google Ad Manager publishers should follow instructions here:
*
E/AndroidRuntime(26196): * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. ;*
E/AndroidRuntime(26196): ******************************************************************************
E/AndroidRuntime(26196):
E/AndroidRuntime(26196):
E/AndroidRuntime(26196): at android.app.ActivityThread.installProvider(ActivityThread.java:6988)
E/AndroidRuntime(26196): at android.app.ActivityThread.installContentProviders(ActivityThread.java:6528)
E/AndroidRuntime(26196): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6445)
E/AndroidRuntime(26196): at android.app.ActivityThread.access$1300(ActivityThread.java:219)
E/AndroidRuntime(26196): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
E/AndroidRuntime(26196): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(26196): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(26196): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(26196): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(26196): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(26196): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(26196): Caused by: java.lang.IllegalStateException:
E/AndroidRuntime(26196):
E/AndroidRuntime(26196): ******************************************************************************
E/AndroidRuntime(26196): * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
E/AndroidRuntime(26196): * should follow the instructions here:
*
E/AndroidRuntime(26196): * https://googlemobileadssdk.page.link/admob-android-update-manifest ;*
E/AndroidRuntime(26196): * to add a valid App ID inside the AndroidManifest.
*
E/AndroidRuntime(26196): * Google Ad Manager publishers should follow instructions here:
*
E/AndroidRuntime(26196): * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. ;*
E/AndroidRuntime(26196): ******************************************************************************
E/AndroidRuntime(26196):
E/AndroidRuntime(26196):
E/AndroidRuntime(26196): at com.google.android.gms.ads.internal.client.zzek.attachInfo(com.google.android.gms:play-services-ads-lite@@22.0.0:26)
E/AndroidRuntime(26196): at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@22.0.0:1)
E/AndroidRuntime(26196): at android.app.ActivityThread.installProvider(ActivityThread.java:6983)
E/AndroidRuntime(26196): ... 10 more
-
android>app>build.gradle 전문
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.mymemo_admob"
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.mymemo_admob"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 19
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
