- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在使用 AndroidStudio 并试图根据设置的 google play API 在我的应用程序上转换一些广告 - https://developer.android.com/google/play-services/setup.html
Adter 我将项目与 grandle 文件同步时出现此错误:
Error:Failed to find: com.google.android.gms:play-services:5.0.77
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile">Open File</a><br><a href="open.dependency.in.project.structure">Open in Project Structure dialog</a>
这是我的 gradle.build:
apply plugin: 'com.android.application'
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.pachu.fartsounds"
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.google.android.gms:play-services:5.0.77'
}
我的 list :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pachu.fartsounds">
<application
android:allowBackup="true"
android:icon="@drawable/fart_icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".FartActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
有什么想法吗?谢谢!
最佳答案
您缺少 list 的关键组件。您收到的 SDK 错误是因为编译器不知道在哪个 SDK 级别编译您的应用程序 - 您缺少 <uses-sdk
.
当我们这样做时,您还缺少包名称、版本名称和版本代码。这些都是您应用程序的关键组件。以下是格式正确的 list 示例:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.exampleapp"
android:versionCode="2"
android:versionName="v0.2-Alpha" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.GET_TASKS" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.exampleapp.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:enabled="true" android:name="com.example.exampleapp.MyService" />
</application>
</manifest>
请注意最顶部:阅读 package
的部分, android:versionCode
, 和 android:versionName
.而且,在这些之下,以 <uses-sdk
开头的整个部分...这些都是必需的。
关于缺少 android.compileSdkVersion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25202995/
这是对我的问题的跟进:Could not find com.android.tools.build:gradle:3.2.1. in a sample project from github 我正在尝
在 Gradle.build 文件中,我看到一些项目使用 compileSdkVersion="'Google Inc.:Google APIs:23" 有些只是用数字 compileSdkVersi
我有一个创建javadocs的任务: Task tCreateJavadocs = addTask(project, 'createJavadocs', Javadoc.class) tCreateJ
我在 Windows 上使用 react-native 应用程序。当我执行 react-native run-android 时,我收到错误 compileSdkVersion on extra pr
我正在使用 AndroidStudio 并试图根据设置的 google play API 在我的应用程序上转换一些广告 - https://developer.android.com/google/p
我正在尝试运行以下命令: ionic cordova run android --device 但我收到以下错误 BUILD FAILED in 3s (node:3956) Unha
所以我知道compileSdkVersion是应用程序编译所针对的 API 版本。而targetSdkVersion是应用测试的版本。 我正在使用一个库,它需要更高 API 版本中存在的一些属性,我需
apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "26
我的 compileSDKversion 是 26,所以我想在应用 build.gradel 中添加一些支持库,例如 implementation 'com.android.support:card
我使用 android studio,在 build.gradle 文件中,一些依赖项用红色下划线标出。消息是: 此支持库不应使用与 compileSdkVersion (26) 不同的版本 (25)
有人可以帮我做 build.gradle 吗? 我要编辑的存储库是 https://github.com/ZonCon/Wedding-Retronight-Android/tree/master/a
有人请帮助我......无法在额外属性扩展上获取属性“compileSdkVersion”,因为它在 android studio 中不存在。 最佳答案 转到“项目文件” View 并打开构建 gra
我正在使用 Android Studio 1.2.2 开发 Android 应用程序。在我的 build.gradle 文件中,我从工作开始就将 compileSdkVersion 定义为 21。现在
我担心我应该将compileSdkVersion、minSdkVersion 和targetSdkVersion 设置成什么。 我首先担心的是,如果我将 compileSdkVersion 设置为目前
我的应用程序中有一个关于框,显示有关应用程序、手机及其使用的数据的信息。当用户遇到问题时,它非常有用。我可以使用“android.os.Build.VERSION.SDK_INT”获取手机的 SDK
我对 github 中的项目有问题 https://github.com/joaopedronardari/OpenCV-AndroidSamples我在我的 android studio 中克隆,然
> Task :prepareKotlinBuildScriptModel UP-TO-DATE Gradle import errorsD:\Important_Docs\Projects\Back
我看过documentation用于使用 Gradle 进行构建,但我仍然不确定 compileSdkVersion 和 targetSdkVersion 之间有什么区别。 它说的是: The `co
我正在尝试构建我的库并将其上传到存储库,但不幸的是,gradle 构建失败了。我花了几个小时试图修复此错误,但我所做的一切都无济于事。 这是根项目目录中的 build.gradle。 buildscr
我将从 GitHub 下载的项目作为模块导入到我的 Android Studio 项目中。“导入模块...”向导工作正常,但是当 Adroid Studio 尝试重建项目时,它返回给我这个错误: Ca
我是一名优秀的程序员,十分优秀!