1

In this case I used Facebook audience network for show ads in my Android apps but I all time got an error that is "no fill".

Here is my code

public class FacebookAdsShowActivity extends AppCompatActivity {
private AdView adView;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_facebook_ads_show);
    adView = new AdView(this, "2604007993014170_2604011093013860", AdSize.BANNER_HEIGHT_50);
    LinearLayout adContainer = (LinearLayout) findViewById(R.id.banner_container);
    adContainer.addView(adView);
    adView.setAdListener(new AdListener() {
        @Override
        public void onError(Ad ad, AdError adError) {
            Toast.makeText(FacebookAdsShowActivity.this, "Error: " + adError.getErrorMessage(),Toast.LENGTH_LONG).show();
        }
        @Override
        public void onAdLoaded(Ad ad) {
        }
        @Override
        public void onAdClicked(Ad ad) {
        }
        @Override
        public void onLoggingImpression(Ad ad) {
        }
    });
    adView.loadAd();
}
@Override
protected void onDestroy() {
    if (adView != null) {
        adView.destroy();
    }
    super.onDestroy();
}
}

My build.gradle(app module) dependency are:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.facebook.android:audience-network-sdk:5.6.0'
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:25.3.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
halfer
  • 19,824
  • 17
  • 99
  • 186
Modhu Mala
  • 19
  • 2
  • Check this: https://stackoverflow.com/questions/47055218/how-to-resolve-error-1001-no-fill-using-facebook-audience-network-in-android – Md. Asaduzzaman Dec 08 '19 at 10:06
  • Also Check FB Community: https://www.facebook.com/help/community/question/?id=1494007767293505 – Md. Asaduzzaman Dec 08 '19 at 10:07
  • @ChanakaWeerasinghe: please do not add new comments when editing questions. In this case you added case errors, spelling errors and missed off punctuation, so I have voted to reject the edit. – halfer Dec 08 '19 at 11:33

0 Answers0