我根据http://developer.android.com/google/play-services/setup.html完成了所有事情,但是书架甚至都没有被识别出来。 http://oi61.tinypic.com/hs80gz.jpg正如您所看到的对象是红色的,所以它们不起作用,但没有错误。干净利落,没有工作。
以下是gradle代码:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.r.ugani"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
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:21.0.3'
compile 'com.google.android.gms:play-services:6.5.+'
}
这是清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.r.ugani">
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".Splash"
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>
<activity
android:name=".Main"
android:label="@string/title_activity_main"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="Ugani.Main" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Correct"
android:label="@string/title_activity_correct"
android:screenOrientation="landscape">
</activity>
<activity
android:name=".Pass"
android:label="@string/title_activity_pass"
android:screenOrientation="landscape" >
</activity>
<activity
android:name=".Results"
android:label="@string/title_activity_results"
android:screenOrientation="landscape" >
</activity>
<activity
android:name=".Instructions"
android:label="@string/title_activity_instructions"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="Ugani.Instructions" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Game"
android:label="@string/title_activity_game"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="Ugani.Game" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".PreTimer"
android:label="@string/title_activity_pre_timer"
android:screenOrientation="landscape" >
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
</manifest>
答案 0 :(得分:0)
我不能发表评论,因为我没有50名代表 快问,您是否已将必要的库下载到项目中?