在我的项目中包含 material-intro 时,找不到与给定名称匹配的资源(在 'theme' 处,值为 '@style/Theme.Intro')
No resource found that matches the given name (at 'theme' with value '@style/Theme.Intro') when including material-intro in my project
我想为我的应用程序添加一个介绍向导(当您第一次使用它时)。
我使用这个库作为来源:https://github.com/HeinrichReimer/material-intro
所以基本上我所做的就是将他的库文件夹复制到我的项目根位置,并在构建项目后出现以下错误:
No resource found that matches the given name (at 'theme' with value '@style/Theme.Intro').
更详细的错误日志:
C:\Users\abhishek rai\AndroidStudioProjects\DonationApp\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(30, 28) No resource found that matches the given name (at 'theme' with value '@style/Theme.Intro').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\abhishek rai\AppData\Local\Android\sdk\build-tools.0.2\aapt.exe'' finished with non-zero exit value 1
AndroidManifest.xml中的代码是:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="minor.da.com.donationapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name="minor.da.com.donationapp.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="minor.da.com.donationapp.MaterialIntroActivity"
android:parentActivityName="minor.da.com.donationapp.MainActivity"
android:theme="@style/Theme.Intro" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity android:name="minor.da.com.donationapp.FinishActivity" >
</activity>
<activity
android:name="minor.da.com.donationapp.Front_page"
android:label="@string/app_name" >
</activity>
<activity android:name="minor.da.com.donationapp.SecondPage" />
<activity
android:name="android.support.v7.widget.TestActivity"
android:label="RecyclerViewTestActivity" />
</application>
</manifest>
如果你使用像 material-intro 这样的 Android 库,那么复制源代码不是你通常会做的,我显然不鼓励你这样做。
您绝对应该按照其自述文件中所述将其作为 Gradle 依赖项包含在内:
将其放入您的 项目 的 build.gradle:
allprojects {
//...
repositories {
//...
maven {
url 'https://jitpack.io'
}
}
}
然后将其放入您的模块的build.gradle:
dependencies {
//...
compile 'com.heinrichreimersoftware:material-intro:1.2.1'
}
如果您 运行 遇到麻烦,请更新问题以包含您的 Gradle 文件。
我想为我的应用程序添加一个介绍向导(当您第一次使用它时)。 我使用这个库作为来源:https://github.com/HeinrichReimer/material-intro 所以基本上我所做的就是将他的库文件夹复制到我的项目根位置,并在构建项目后出现以下错误:
No resource found that matches the given name (at 'theme' with value '@style/Theme.Intro').
更详细的错误日志:
C:\Users\abhishek rai\AndroidStudioProjects\DonationApp\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(30, 28) No resource found that matches the given name (at 'theme' with value '@style/Theme.Intro').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\abhishek rai\AppData\Local\Android\sdk\build-tools.0.2\aapt.exe'' finished with non-zero exit value 1
AndroidManifest.xml中的代码是:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="minor.da.com.donationapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name="minor.da.com.donationapp.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="minor.da.com.donationapp.MaterialIntroActivity"
android:parentActivityName="minor.da.com.donationapp.MainActivity"
android:theme="@style/Theme.Intro" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity android:name="minor.da.com.donationapp.FinishActivity" >
</activity>
<activity
android:name="minor.da.com.donationapp.Front_page"
android:label="@string/app_name" >
</activity>
<activity android:name="minor.da.com.donationapp.SecondPage" />
<activity
android:name="android.support.v7.widget.TestActivity"
android:label="RecyclerViewTestActivity" />
</application>
</manifest>
如果你使用像 material-intro 这样的 Android 库,那么复制源代码不是你通常会做的,我显然不鼓励你这样做。 您绝对应该按照其自述文件中所述将其作为 Gradle 依赖项包含在内:
将其放入您的 项目 的 build.gradle:
allprojects {
//...
repositories {
//...
maven {
url 'https://jitpack.io'
}
}
}
然后将其放入您的模块的build.gradle:
dependencies {
//...
compile 'com.heinrichreimersoftware:material-intro:1.2.1'
}
如果您 运行 遇到麻烦,请更新问题以包含您的 Gradle 文件。