简体   繁体   中英

Where can i find the build.gradle file for admob

I am trying to setup an admob by following the example. I have installed the google play service. In my project, I can't see a file called build.gradle.

You should have a project-level build.gradle file and an application-level build.gradle file

How do i get those file

I even go under eclipse sdk folder but couldn't find the google play service anywhere.

build.gradle is a file used by Android Studio . You should probably migrate your Eclipse project to an Android Studio one.

Instructions on how to migrate from Eclipse to Android Studio:

1.Update your Eclipse ADT Plugin (you must have version 22.0 or higher).

2.In Eclipse, select File > Export.

3.In the window that appears, open Android and select Generate Gradle build files.

4.Select the project you want to export for Android Studio and click Finish.

Your selected project remains in the same location but now contains a build.gradle file and is ready for Android Studio.

After you finished installing Android Studio and exporting your project, continue onto the following steps

1.In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.

2.Click Import Project.

3.Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.

4.In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)

Now you will find the build.gradle file in your project's root directory.

To install Google Play Services Library:

( 1 ) Download Google Play Services SDK

Lunch Android SDK Manager

In the SDK Manager window Scroll down and expand Extras folder Select Google Play services Click Install Package

( 2 ) Import the Library into Workspace

Now you need to import Google Play services library into your app current workspace.

File >> Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it. The Google Play services SDK is saved in your Android SDK environment at /extras/google/google_play_services/.

Click Finish

( 3 ) Add Google Play services to Your App

Right-click your App project Select Properties In the Properties window select Android Under the Library section click Add Select google-play-services-lib Click OK

Instruction found here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM