kmcgill88 / admob_flutter

Admob Flutter plugin that shows banner ads using native platform views.
https://pub.dartlang.org/packages/admob_flutter
ISC License
434 stars 151 forks source link

dont run the app :( what happened? #122

Open krobawsky opened 4 years ago

edeuss commented 4 years ago

Can you give us more info about your issue @krobawsky ?

krobawsky commented 4 years ago

The app works fine, but when I add the dependencie in the pubspec.yaml file the app start slow and close. I don't konw what's goin on. 14b585c2-ab19-4769-a650-b3591b44a258

kmcgill88 commented 4 years ago

Did you follow the install instructions?

hmtanbir commented 4 years ago

@kmcgill88 I also fetch same problem. When I add it in pubspec.yml, my app is going crashed!

abriochebun commented 4 years ago

I had the same problem. I fixed it by making sure I had the app unit id in the manifest file. I accidentally placed the ad unit id. Make sure that the manifest file (if making an android app) and the info.plist (if making an ios app) have a ~ in the middle instead of the /. The app unit id will have a ~ in the middle of it. You can find the app unit id on the AdMob site. It should look something like this: ca-app-pub-3940256099942544~3347511713. I hope this helps!

takekapp1990 commented 4 years ago

I had the same problem too and it was caused by my mistake in the manifest file. I'm working on Android. In the AndroidManifest.xml, I wrongly put the \<meta-data> tag under the \<activity> tag as below and it should be directly under the \<application> tag:

<application
   android:name="io.flutter.app.FlutterApplication"
   ... 
   >
<!--  CORRECT!!! --> 
   <meta-data 
      android:name="com.google.android.gms.ads.APPLICATION_ID"
      android:value="ca-app-pub-xxxxxxxxxxx~xxxxxxxxxxxxxx"/> 
<!--  CORRECT!!!  --> 
   <activity
            android:name=".MainActivity"
            ...
            >
            <meta-data
                android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
                android:value="true" />
<!-- WRONG !!! --> 
            <meta-data 
                android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="ca-app-pub-xxxxxxxxxxx~xxxxxxxxxxxxxx"/> 
<!--  WRONG !!! --> 
            ...
    </activity>
</application>
edeuss commented 4 years ago

@krobawsky did @takekapp1990 suggestion work for you?

sasavas commented 4 years ago

@kmcgill88 I think you should add the installation instructions in the flutter package page and in the main README page of this repository.

kmcgill88 commented 4 years ago

@usavas I've bee very just and haven't been able to work on his project. PR'S are very welcome.

ghost commented 4 years ago

I had a same issue! Solved! thanks @takekapp1990