Android “吨级误差”;检索项的父项时出错:未找到与给定名称匹配的资源;当谷歌玻璃的建设
我正在尝试为谷歌眼镜制作一个应用程序。但是当我尝试同步gradle时,它显示了200个类似这样的错误(有点多,所以我把它放在了pastebin上): 简言之,这些错误属于“检索项的父项时出错:未找到与给定名称匹配的资源”类型,它们来自许多中间文件。这是我的gradle文件:Android “吨级误差”;检索项的父项时出错:未找到与给定名称匹配的资源;当谷歌玻璃的建设,android,android-appcompat,google-glass,Android,Android Appcompat,Google Glass,我正在尝试为谷歌眼镜制作一个应用程序。但是当我尝试同步gradle时,它显示了200个类似这样的错误(有点多,所以我把它放在了pastebin上): 简言之,这些错误属于“检索项的父项时出错:未找到与给定名称匹配的资源”类型,它们来自许多中间文件。这是我的gradle文件: apply plugin: 'com.android.application' repositories { jcenter() flatDir { dirs 'prebuilt-libs'
apply plugin: 'com.android.application'
repositories {
jcenter()
flatDir {
dirs 'prebuilt-libs'
}
}
android {
compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.zeroexperiencestudio.glassqr"
minSdkVersion 19
targetSdkVersion 25
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.journeyapps:zxing-android-embedded:3.4.0'
compile 'com.android.support:appcompat-v7:25.0.2'
compile 'com.android.support:recyclerview-v7:25.0.2'
}
为什么会这样?我该如何解决这个问题
这是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zeroexperiencestudio.glassqr">
<application
android:hardwareAccelerated="false"
android:largeHeap="true"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
>
<activity
android:name=".MainActivityTest"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="@xml/voice" />
</activity>
</application>
</manifest>
如果您正在使用,请尝试从AndroidManifest.xml
文件中删除android:theme
。不幸的是,我的清单中没有任何android:theme
,并使用谷歌眼镜的默认主题。无论如何,谢谢你。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zeroexperiencestudio.glassqr">
<application
android:hardwareAccelerated="false"
android:largeHeap="true"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
>
<activity
android:name=".MainActivityTest"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="@xml/voice" />
</activity>
</application>
</manifest>