简体   繁体   English

Visual Studio:在哪里可以编辑我的Android应用程序的依赖项?

[英]Visual Studio: Where can I edit the dependencies of my android app?

I'm right now at monetizing my app. 我现在正在通过我的应用获利。 In order to do this, I need to do the following: 为此,我需要执行以下操作:

Import the Mobile Ads SDK 导入移动广告SDK

Apps can import the Google Mobile Ads SDK with a gradle dependency. 应用可以导入具有gradle依赖关系的Google Mobile Ads SDK。 Open the app-level build.gradle file for your app, and look for a "dependencies" section. 打开您的应用程序的应用程序级别build.gradle文件,然后查找“依赖项”部分。

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile com.google.android.gms:play-services-ads:10.2.4'
}

I can absolutely NOT find this page where I can edit the dependencies. 我绝对找不到可以编辑依赖项的页面。 Can anyone hint me towards the right direction? 谁能向我暗示正确的方向? THANKS :) 谢谢 :)

In Xamarin the dependencies need to be binded to C#. 在Xamarin中,依赖项需要绑定到C#。 Luckily you do not have do that on your own for the Android Support AppCompat v7 and Play Services Ads because there are nuget packages: 幸运的是,您没有针对Android支持AppCompat v7和Play Services Ads单独执行此操作,因为其中包含nuget软件包:

https://www.nuget.org/packages/Xamarin.GooglePlayServices.Ads/ https://www.nuget.org/packages/Xamarin.Android.Support.v7.AppCompat/ https://www.nuget.org/packages/Xamarin.GooglePlayServices.Ads/ https://www.nuget.org/packages/Xamarin.Android.Support.v7.AppCompat/

Just right click "References" in your Xamarin Android project and click "Manage NuGet Packages" and install the packages mentioned above or make use of the package manager console. 只需在Xamarin Android项目中右键单击“参考”,然后单击“管理NuGet程序包”并安装上述程序包或使用程序包管理器控制台即可。

Inside your App Module you can find build.gradle file there you can write your dependency as.
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.example.satyamanand.helloworld"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.3.1'
    testCompile 'junit:junit:4.12'
}

在Android Studio中检出应用程序结构。

Inside Android Studio checkout the application Structure. 在Android Studio中检出应用程序结构。

You can't find Gradle dependencies because you're not using Gradle, you're using xamarin which is not the same as native Android Development using Android Studio. 您找不到Gradle依赖项,因为您没有使用Gradle,而是使用xamarin,这与使用Android Studio的本机Android开发不同。

Looking at and Android Docs for this sort of thing will perhaps not be so useful. 在Android Docs中查找此类信息可能不会那么有用。

I suggest you look here at the Xamarin Google Play Services module , this should get you started in the right direction. 建议您在这里查看Xamarin Google Play服务模块 ,这应该可以帮助您正确地开始工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在哪里可以将单个依赖项放在Android Studio中? - Where can I put individual dependencies in Android Studio? 如何查看我的 Xamarin.Forms 应用程序是否在 Visual Studio 中的 Android 6(或更高版本)上运行或/和可运行? - How can I see if my Xamarin.Forms app is working or/and runnable on Android 6 (or higher) in Visual Studio? 我的Visual Studio Android模拟器在哪里? - Where are my Visual Studio Android emulators? 我可以在xamarin应用程序中打印Visual Studio日志吗? - Can I print the Visual Studio log in my xamarin app? 我在哪里可以将我的自定义模板放在 Android Studio 4.1 中 - Where can I put my custom template in Android Studio 4.1 当我尝试在 Android Studio 中运行我的应用程序时,“编辑配置” - When I try to run my app back in Android Studio an “Edit Configuration” 我在哪里编码华为在 android studio 上的应用内购买以及我如何将我的应用与 IAP 链接 - where i code Huawei In-app purchase on android studio and how i link my app with IAP 在哪里可以找到我的应用程序中的Android数据库文件? - Where I can Find Android database file in my app? 我如何在 android studio 中构建和运行我的应用程序 - How i can build and run my app in android studio 我无法在 Android Studio 中为我的应用设置图标 - I can't set an icon for my app in Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM