I'm trying to set up firebase admob for my Android project.
After following the instructions on the Google site with this code:
Code: Select all
Game::jniEnv = 0;
Game::state->activity->vm->AttachCurrentThread(&Game::jniEnv, NULL);
// Create the Firebase app.
firebase::App* app =
firebase::App::Create(firebase::AppOptions(),
Game::jniEnv,
Game::state->activity->clazz);
// Your Android AdMob app ID.
const char* kAdMobAppID = "xxxxxxxxxx";
// Initialize the AdMob library with your AdMob app ID.
firebase::admob::Initialize(*app, kAdMobAppID);
///
firebase::admob::InterstitialAd* interstitial_ad;
interstitial_ad = new firebase::admob::InterstitialAd();
const char* kInterstitialAdUnit = "xxxxxxxxxx";
// my_ad_parent is a reference to an iOS UIView or an Android Activity.
// This is the parent UIView or Activity of the interstitial ad.
interstitial_ad->Initialize(static_cast<firebase::admob::AdParent>(Game::state->activity->clazz), kInterstitialAdUnit);
Code: Select all
firebase::App* app = firebase::App::Create(firebase::AppOptions(), Game::jniEnv, Game::state->activity->clazz);
After adding these to my..
AndroidManifest.xml
Code: Select all
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
Code: Select all
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
Code: Select all
[javac] C:\Users\Admin\Desktop\Project\app\src\com\Project\app\Project.java:22: error: package com.google.android.gms.ads does not exist
[javac] import com.google.android.gms.ads.InterstitialAd;
[javac] ^
[javac] C:\Users\Admin\Desktop\Project\app\src\com\Project\app\Project.java:23: error: package com.google.android.gms.ads does not exist
[javac] import com.google.android.gms.ads.AdListener;
[javac] ^
[javac] C:\Users\Admin\Desktop\Project\app\src\com\Project\app\Project.java:24: error: package com.google.android.gms.ads does not exist
[javac] import com.google.android.gms.ads.AdRequest;
[javac] ^
[javac] C:\Users\Admin\Desktop\Project\app\src\com\Project\app\Project.java:25: error: package com.google.android.gms.ads does not exist
[javac] import com.google.android.gms.ads.AdSize;
[javac] ^
[javac] C:\Users\Admin\Desktop\Project\app\src\com\Project\app\Project.java:26: error: package com.google.android.gms.ads does not exist
[javac] import com.google.android.gms.ads.AdView;
[javac] ^
[javac] 5 errors
[javac] 3 warnings
Code: Select all
Error:(113, 28) No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').
Thanks
NOTE:
I have installed the Google Play services from Android Studio.
I am using ant, so Gradle answers (the only answers I could find online) will not work.