我可以在调试模式下运行项目。
关于我的Android gradle设置
build.gradle:
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
..
minSdkVersion 16
targetSdkVersion 27
..
}
..
dependencies {
implementation project(':react-native-youtube')
implementation project(':react-native-admob')
implementation project(':react-native-photo-view')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-vector-icons')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.facebook.react:react-native:+" // From node_modules
}
android / build.gradle:
buildscript {
repositories {
maven { url "https://maven.google.com" }
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
}
}
afterEvaluate {
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
targetSdkVersion 27
}
}
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
当我在项目根目录下键入命令cd android && ./gradlew assembleRelease
尝试构建发行版APK时,出现错误:
Uncompiled PNG file passed as argument
我从github https://github.com/react-navigation/react-navigation/issues/4755
搜索解决方案因此,我在android.enableAapt2=false
文件上添加了gradle.properities
,但是它对我不起作用。
当我再次输入cd android && ./gradlew assembleRelease
g时,出现错误提示:
* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> Failed to process resources, see aapt output above for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
我完全不知道如何解决它。
任何帮助将不胜感激。预先感谢。