gpt4 book ai didi

缺少 android.compileSdkVersion

转载 作者:搜寻专家 更新时间:2023-11-01 08:49:15 26 4
gpt4 key购买 nike

我正在使用 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com