使用React-Native为Android构建我的应用程序时遇到问题。我最近在我的应用程序上没有做太多更改,但是某些变化似乎突然发生了变化,这肯定是由于我的依赖性之一。
当我尝试运行assembleRelease
时,出现以下错误:
/root/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/9dc7663ea18f37ca9d48501ef1071cf3/res/values-v24/values-v24.xml:3:5-157: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
/root/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/9dc7663ea18f37ca9d48501ef1071cf3/res/values-v24/values-v24.xml:4:5-135: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
/root/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/9dc7663ea18f37ca9d48501ef1071cf3/res/values-v26/values-v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jail-monkey:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
但是,当我运行assembleDebug
时,一切进展顺利,所以我不确定是什么问题。
该构建在没有缓存的Linux Docker映像上运行,并且具有最新版本的sdk-tools 26.1.1。
根据我在网上阅读的内容,此问题似乎来自appcompat,它不是正确的版本。出现问题的依赖项似乎是jail-monkey,它已经有几个月没有更新了。
在我的build.gradle中,这是我的一些依赖项:
implementation project(':react-native-svg')
implementation project(':react-native-config')
implementation project(':jail-monkey')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-base:15.0.0'
implementation 'com.google.android.gms:play-services-base:15.0.0'
implementation 'com.android.support:appcompat-v7:23.0.0'
implementation 'com.facebook.react:react-native:+'
我试图在gradle文件中将appcompact-v7设置为23、26、27和28,但它们都没有起作用。尽管在构建过程中似乎从依赖项中使用26.1。
compileSdkVersion 27
buildToolsVersion '27.0.3'
您是否知道如何解决此问题?