Closed GunturThunder closed 1 year ago
@GunturThunder I was facing this issue and changing the lines below, work for me.
from:
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
...
}
to:
android {
compileSdkVersion 31
buildToolsVersion "31.0.0"
....
}
this is how i fix the issue, first go to android folder
A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
here is the build.gradle the library buildscript { repositories { jcenter { url "https://jcenter.bintray.com/" } maven {url "https://repo.spring.io/plugins-release/"} mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } }
}
apply plugin: 'com.android.library'
android { compileSdkVersion 27 buildToolsVersion "27.0.3"
}
repositories { jcenter { url "https://jcenter.bintray.com/" } maven {url "https://repo.spring.io/plugins-release/"} mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } }
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.facebook.react:react-native:+' // From node_modules implementation group: 'com.android.support', name: 'support-v4', version: '27.0.0' implementation "com.google.zxing:core:3.3.0" }
here is the build.gradle of project build.gradle apply plugin: "com.android.application"
import com.android.build.OutputFile import org.apache.tools.ant.taskdefs.condition.Os
/**
react-native bundle
with the correct arguments during the Android buildapply from: "../../node_modules/react-native/react.gradle"
line.project.ext.react = [ enableHermes: true, // clean and rebuild if changing ]
apply from: "../../node_modules/react-native/react.gradle"
/**
/**
/**
def jscFlavor = 'org.webkit:android-jsc-intl:+'
Date.toLocaleString
andString.localeCompare
that/**
/**
android { ndkVersion rootProject.ext.ndkVersion
}
dependencies { implementation fileTree(dir: "libs", include: ["*.jar"])
}
if (isNewArchitectureEnabled()) { // If new architecture is enabled, we let you build RN from source // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. // This will be applied to all the imported transtitive dependency. configurations.all { resolutionStrategy.dependencySubstitution { substitute(module("com.facebook.react:react-native")) .using(project(":ReactAndroid")) .because("On New Architecture we're building React Native from source") substitute(module("com.facebook.react:hermes-engine")) .using(project(":ReactAndroid:hermes-engine")) .because("On New Architecture we're building Hermes from source") } } }
// Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.implementation into 'libs' } project.ext.vectoricons = [ iconFontNames: [ 'MaterialIcons.ttf', 'Ionicons.ttf' ] // Name of the font files you want to copy ]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
def isNewArchitectureEnabled() { // To opt-in for the New Architecture, you can either: // - Set
newArchEnabled
to true inside thegradle.properties
file // - Invoke gradle with-newArchEnabled=true
// - Set an environment variableORG_GRADLE_PROJECT_newArchEnabled=true
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" }