I have resumed a project that I started a few months ago, an app that I am building in react native. The problem is that when going to compile it told me that I had to update to eas. I have updated and now when trying to do a build it tells me:
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/node_modules/#unimodules/core/android/build.gradle' line: 3
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':unimodules-core'.
[stderr] > Plugin with id 'maven' not found.
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':expo'.
[stderr] >
[stderr] compileSdkVersion is not specified. Please add it to build.gradle
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 1m 43s
my code in build.gradle is the following (I've already changed the maven call to maven-publish but it's still the same):
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
group = 'org.unimodules'
version = '6.7.1'
buildscript {
// Simple helper that allows the root project to override versions declared by this library.
ext.safeExtGet = { prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:6.7.1'
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
}
}
//Upload android library to maven with javadoc and android sources
configurations {
deployerJars
}
//Creating sources with comments
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
//Put the androidSources and javadoc to the artifacts
artifacts {
archives androidSourcesJar
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: mavenLocal().url)
}
}
}
android {
compileSdkVersion safeExtGet("compileSdkVersion", 30)
buildToolsVersion safeExtGet("buildToolsVersion", 30)
minSdkVersion safeExtGet("minSdkVersion", 21)
targetSdkVersion safeExtGet("targetSdkVersion", 21)
buildToolsVersion "30.0.1"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
compileSdkVersion 30
minSdkVersion safeExtGet("minSdkVersion", 21)
targetSdkVersion safeExtGet("targetSdkVersion", 30)
consumerProguardFiles 'proguard-rules.pro'
versionCode 20
versionName "7.1.2"
minSdkVersion 21
targetSdkVersion 30
buildToolsVersion "30.0.1"
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
}
Do you know how I can solve it? Thanks.
Related
I am getting this Error message while building my react native project.
BUILD FAILED in 4s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\sawan\OneDrive\Desktop\Unsplash\app\node_modules\react-native-safe-area-context\android\build.gradle' line: 28
* What went wrong:
A problem occurred evaluating project ':react-native-safe-area-context'.
> Could not initialize class org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-safe-area-context'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* 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.
==============================================================================
Its saying error is in this file:
C:\Users\sawan\OneDrive\Desktop\Unsplash\app\node_modules\react-native-safe-area-context\android\build.gradle
//rest of the code ...
android {
compileSdkVersion getExtOrDefault('compileSdkVersion', 30)
// Used to override the NDK path/version on internal CI or by allowing
// users to customize the NDK path/version from their root project (e.g. for M1 support)
if (rootProject.hasProperty("ndkPath")) {
ndkPath rootProject.ext.ndkPath
}
if (rootProject.hasProperty("ndkVersion")) {
ndkVersion rootProject.ext.ndkVersion
}
defaultConfig {
minSdkVersion getExtOrDefault('minSdkVersion', 16)
targetSdkVersion getExtOrDefault('targetSdkVersion', 28)
versionCode 1
versionName "1.0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
ndk {
abiFilters (*reactNativeArchitectures())
}
}// rest of the code ....
Here is my build.gradle file from \android
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
// kotlin_version = '1.5.20' //
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.facebook.react:react-native-gradle-plugin")
// classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") //
}}
Don't know if error is in this path or the build.gradle file
When I try to build my expo react native app using expo EAS services I get this error as follows,
Please consult deprecation warnings for more details.
426 actionable tasks: 426 executed
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:bundleReleaseJsAndAssets'.
[stderr] > Process 'command 'node'' finished with non-zero exit value 1
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 3m 8s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
my eas.json looks like this,
{
"cli": {
"version": ">= 2.4.1"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"android": {
"image": "ubuntu-18.04-jdk-11-ndk-r19c"
}
},
"preview": {
"distribution": "internal"
},
"production": {
"android": {
"buildType": "apk"
}
}
},
"submit": {
"production": {}
}
}
my app configuration is as follows,
minSdkVersion = '21'
buildToolsVersion = '31.0.0'
compileSdkVersion = '33'
targetSdkVersion = '33'
I'm trying to generate an apk here.
Can someone help, please
The real cause of the issue should be logged somewhere above
I am getting the error after running react-native run-android --
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
>
Android resource linking failed
Output: /../../bitbucket/app/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:293: error: resource android:attr/fontVariationSettings not found.
/../../bitbucket/app/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:293: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: /../../.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/5a5e4d34c69b7e8b3552937157493c40/aapt2-3.2.1-4818971-osx/aapt2 link -I\
/../../Library/Android/sdk/platforms/android-27/android.jar\
--manifest\
/../../bitbucket/app/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/../../bitbucket/app/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
#/../../bitbucket/app/android/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/../../bitbucket/app/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--custom-package\
com.app\
-0\
apk\
--output-text-symbols\
/../../bitbucket/app/android/app/build/intermediates/symbols/debug/R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
Output: /../../.gradle/caches/transforms-1/files-1.1/drawee-1.10.0.aar/ac1ce9b9fcfb8b8c996ede4ab043d5d6/res/values/values.xml:3:5-58:857: AAPT: error: resource android:attr/fontVariationSettings not found.
/../../.gradle/caches/transforms-1/files-1.1/drawee-1.10.0.aar/ac1ce9b9fcfb8b8c996ede4ab043d5d6/res/values/values.xml:3:5-58:857: AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: /../../.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/5a5e4d34c69b7e8b3552937157493c40/aapt2-3.2.1-4818971-osx/aapt2 link -I\
/../../Library/Android/sdk/platforms/android-27/android.jar\
--manifest\
/../../bitbucket/app/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/../../bitbucket/app/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
#/../../bitbucket/app/android/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/../../bitbucket/app/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--custom-package\
com.app\
-0\
apk\
--output-text-symbols\
/../../bitbucket/app/android/app/build/intermediates/symbols/debug/R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
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
BUILD FAILED in 47s
73 actionable tasks: 72 executed, 1 up-to-date
I have already updated the sdk versions and react-native-device-info version. Still facing the issue.
dependencies : app/build.gradle:
dependencies
{
compile project(':react-native-wheel-picker')
compile project(':react-native-vector-icons')
compile project(':react-native-image-picker')
compile project(':react-native-geolocation-service')
compile project(':react-native-fused-location')
compile project(':react-native-android-open-settings')
compile project(':react-native-gesture-handler')
compile project(':react-native-fs')
compile project(':react-native-device-info')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
compile 'com.android.support:multidex:1.0.3'
}
android/build.gradle:
buildscript
{
ext
{
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 26
supportLibVersion = "26.1.0"
googlePlayServicesVersion = "16.+"
}
repositories
{
google()
jcenter()
}
dependencies
{
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:1.4.0-beta3'
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
}
}
}
}
wrapper {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
I am new to react native. When I run react-native run-android I get this error.
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Stay Hungry\app developement\Aarogya\node_modules\react-native-share\android\build.gradle' line: 53
* What went wrong:
A problem occurred evaluating project ':react-native-share'.
> Could not find method compileOnly() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7 mins 24.686 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
I traced the path to the error location and my build.gradle is below:
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
apply plugin: 'com.android.library'
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 27)
buildToolsVersion safeExtGet('buildToolsVersion', '27.0.3')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 27)
versionCode 1
versionName "1.0.0"
}
lintOptions {
abortOnError false
warning 'InvalidPackage'
}
}
repositories {
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
jcenter()
}
dependencies {
compileOnly "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
implementation "com.android.support:appcompat-v7:${safeExtGet('supportLibVersion', '27.1.0')}"
}
I have no idea what is wrong here. I have not even started writing code in app.js yet. I am using a physical device to run the code with an adb device.
The error you are getting is from the library react-native-share.
Did you follow the instructions to installing it right?
i build react-native for android apk has error, need you help!
error info:
C:\Users\Chris.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\5934c37098d7fc1d388cdfd621f50e8f\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.Mater
ial.Widget.Button.Borderless.Colored'.
C:\Users\Chris.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\5934c37098d7fc1d388cdfd621f50e8f\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.Mater
ial.Widget.Button.Colored'.
C:\Users\Chris.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\5934c37098d7fc1d388cdfd621f50e8f\res\values-v26\values-
v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
FAILURE: Build failed with an exception.
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 ge
t full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1m 50s
94 actionable tasks: 2 executed, 92 up-to-date
config info :
...
android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.helloworld"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
manifestPlaceholders = [
JPUSH_APPKEY: "01e91c7c174c2c6888228f25",
APP_CHANNEL : "default"
]
...
ndk {
abiFilters "armeabi-v7a", "x86"
}
}