R. cannot be resolved as a variable..

44 views
Skip to first unread message

Devon Guzzi

unread,
Jun 27, 2014, 2:12:18 PM6/27/14
to google-adm...@googlegroups.com
package com.kilobolt.ZombieBird;

import android.os.Bundle;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;

public class MainActivity extends AndroidApplication {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
        cfg.useGL20 = false;
        
        initialize(new ZBGame(), cfg);
        
        // Look up the AdView as a resource and load a request.
        AdView adView = (AdView)this.findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        adView.loadAd(adRequest);
    }
}




i keep getting an error about R not being a variable while also adVeiw and findViewById are not variables either

Amy Quispe (AdMob SDK Team)

unread,
Jul 2, 2014, 7:20:12 PM7/2/14
to google-adm...@googlegroups.com
Hi Devon,

The code looks fine. Can I see your XML? Are you still having trouble with this?

Amy Quispe
Reply all
Reply to author
Forward
0 new messages