I recently upgraded my expo's SDK version from 35 to 41 and also upgraded expo-cli from 3.18.5 to 4.4.3.
However, when I try to build a standalone APK/AAB, I'm getting the following error:
× Build failed. Standalone build failed!
In order to understand what was exactly causing this issue, I examined the Gradle logs of build Gradle on expo, and here's what I was able to find.
Installing unimodules:
unimodules-core#7.1.0 from /app/turtle/workingdir/android/sdk41/packages/#unimodules/core
unimodules-react-native-adapter#6.2.2 from /app/turtle/workingdir/android/sdk41/packages/#unimodules/react-native-adapter
expo-application#3.1.2 from /app/turtle/workingdir/android/sdk41/packages/expo-application
expo-barcode-scanner#10.1.2 from /app/turtle/workingdir/android/sdk41/packages/expo-barcode-scanner
expo-camera#11.0.2 from /app/turtle/workingdir/android/sdk41/packages/expo-camera
expo-constants#10.1.3 from /app/turtle/workingdir/android/sdk41/packages/expo-constants
expo-error-recovery#2.1.0 from /app/turtle/workingdir/android/sdk41/packages/expo-error-recovery
expo-file-system#11.0.2 from /app/turtle/workingdir/android/sdk41/packages/expo-file-system
expo-font#9.1.0 from /app/turtle/workingdir/android/sdk41/packages/expo-font
expo-image-loader#2.1.1 from /app/turtle/workingdir/android/sdk41/packages/expo-image-loader
expo-keep-awake#9.1.2 from /app/turtle/workingdir/android/sdk41/packages/expo-keep-awake
expo-notifications#0.11.6 from /app/turtle/workingdir/android/sdk41/packages/expo-notifications
unimodules-app-loader#2.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-app-loader
expo-permissions#12.0.1 from /app/turtle/workingdir/android/sdk41/packages/expo-permissions
unimodules-barcode-scanner-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-barcode-scanner-interface
unimodules-camera-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-camera-interface
unimodules-constants-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-constants-interface
unimodules-face-detector-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-face-detector-interface
unimodules-file-system-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-file-system-interface
unimodules-font-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-font-interface
unimodules-image-loader-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-image-loader-interface
unimodules-permissions-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-permissions-interface
unimodules-sensors-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-sensors-interface
unimodules-task-manager-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-task-manager-interface
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :app:preBuild UP-TO-DATE
> Task :app:extractProguardFiles
> Task :app:preReleaseBuild
> Task :app:compileReleaseRenderscript NO-SOURCE
> Task :app:generateReleaseResValues
> Task :app:generateReleaseResources
> Task :app:processReleaseGoogleServices
Parsing json file: /app/turtle/workingdir/android/sdk41/android-shell-app/app/google-services.json
> Task :app:createReleaseCompatibleScreenManifests
> Task :app:extractDeepLinksRelease
> Task :app:mergeReleaseResources
> Task :app:processReleaseMainManifest
[com.facebook.soloader:soloader:0.8.2] /root/.gradle/caches/transforms-3/cfd0b9e5b303f54f13e669e38ab029ae/transformed/jetified-soloader-0.8.2/AndroidManifest.xml Warning:
Package name 'com.facebook.soloader' used in: com.facebook.soloader:soloader:0.8.2, com.facebook.soloader:annotation:0.8.2.
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:35:1-94 Warning:
Element uses-permission#android.permission.SYSTEM_ALERT_WINDOW at AndroidManifest.xml:35:1-94 duplicated with element declared at AndroidManifest.xml:16:3-76
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:23:1-101 Warning:
uses-permission#android.permission.ACCESS_BACKGROUND_LOCATION was tagged at AndroidManifest.xml:23 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:24:1-87 Warning:
uses-permission#android.permission.RECORD_AUDIO was tagged at AndroidManifest.xml:24 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:26:1-89 Warning:
uses-permission#android.permission.WRITE_CONTACTS was tagged at AndroidManifest.xml:26 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:32:1-88 Warning:
uses-permission#android.permission.USE_BIOMETRIC was tagged at AndroidManifest.xml:32 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:33:1-82 Warning:
uses-permission#android.permission.VIBRATE was tagged at AndroidManifest.xml:33 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:34:1-91 Warning:
uses-permission#android.permission.READ_PHONE_STATE was tagged at AndroidManifest.xml:34 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:35:1-94 Warning:
uses-permission#android.permission.SYSTEM_ALERT_WINDOW was tagged at AndroidManifest.xml:35 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:37:1-83 Warning:
uses-permission#android.permission.READ_SMS was tagged at AndroidManifest.xml:37 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:38:1-99 Warning:
uses-permission#android.permission.REQUEST_INSTALL_PACKAGES was tagged at AndroidManifest.xml:38 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:41:1-104 Warning:
uses-permission#com.android.launcher.permission.INSTALL_SHORTCUT was tagged at AndroidManifest.xml:41 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:208:5-213:39 Warning:
activity#com.facebook.FacebookActivity#android:theme was tagged at AndroidManifest.xml:208 to replace other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:17:9-26:20 Warning:
provider#expo.modules.filesystem.FileSystemFileProvider#android:authorities was tagged at AndroidManifest.xml:17 to replace other declarations but no other declaration present
> Task :app:processReleaseManifest
> Task :app:processApplicationManifestReleaseForBundle
> Task :app:mergeReleaseShaders
> Task :app:compileReleaseShaders NO-SOURCE
> Task :app:generateReleaseAssets UP-TO-DATE
> Task :app:mergeReleaseAssets
> Task :app:compileReleaseAidl
NO-SOURCE
> Task :app:generateReleaseBuildConfig
> Task :app:checkReleaseDuplicateClasses
> Task :app:javaPreCompileRelease
> Task :app:checkReleaseAarMetadata
> Task :app:processReleaseJavaRes NO-SOURCE
> Task :app:bundleReleaseResources
> Task :app:mergeReleaseJniLibFolders
> Task :app:collectReleaseDependencies
> Task :app:configureReleaseDependencies
> Task :app:parseReleaseIntegrityConfig
> Task :app:validateSigningRelease
> Task :app:processReleaseManifestForPackage
> Task :app:mergeReleaseNativeLibs
> Task :app:processReleaseResources
> Task :app:mergeReleaseJavaResource
> Task :app:compileReleaseJavaWithJavac
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:8: error: package expo.modules.splashscreen does not exist
[stderr] import expo.modules.splashscreen.SplashScreenImageResizeMode;
[stderr] ^
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:25: error: cannot find symbol
[stderr] public static SplashScreenImageResizeMode SPLASH_SCREEN_IMAGE_RESIZE_MODE = SplashScreenImageResizeMode.CONTAIN;
[stderr] ^
[stderr] symbol: class SplashScreenImageResizeMode
[stderr] location: class AppConstants
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:25: error: cannot find symbol
[stderr] public static SplashScreenImageResizeMode SPLASH_SCREEN_IMAGE_RESIZE_MODE = SplashScreenImageResizeMode.CONTAIN;
[stderr] ^
[stderr] symbol: variable SplashScreenImageResizeMode
[stderr] location: class AppConstants
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:53: error: cannot access SplashScreenImageResizeMode
[stderr] constants.SPLASH_SCREEN_IMAGE_RESIZE_MODE = SPLASH_SCREEN_IMAGE_RESIZE_MODE;
[stderr] ^
[stderr] class file for expo.modules.splashscreen.SplashScreenImageResizeMode not found
[stderr] 4 errors
> Task :app:compileReleaseJavaWithJavac FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:compileReleaseJavaWithJavac'.
[stderr] > Compilation failed; see the compiler error output for details.
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 35s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
26 actionable tasks: 26 executed
Error: ./gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/app/turtle/node_modules/#expo/xdl/node_modules/#expo/spawn-async/build/spawnAsync.js:52:23)
at Object.onceWrapper (events.js:418:26)
at ChildProcess.emit (events.js:311:20)
at ChildProcess.EventEmitter.emit (domain.js:482:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
...
at spawnAsync (/app/turtle/node_modules/#expo/xdl/node_modules/#expo/spawn-async/build/spawnAsync.js:17:21)
at spawnAsyncThrowError (/app/turtle/node_modules/#expo/xdl/build/detach/ExponentTools.js:201:45)
at buildShellAppAsync (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidShellApp.js:976:11)
at async Object.createAndroidShellAppAsync (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidShellApp.js:396:5)
at async runShellAppBuilder (/app/turtle/build/builders/android.js:95:9)
at async Object.buildAndroid [as android] (/app/turtle/build/builders/android.js:43:28)
at async build (/app/turtle/build/jobManager.js:181:33)
at async processJob (/app/turtle/build/jobManager.js:118:32)
at async Object.doJob (/app/turtle/build/jobManager.js:49:5)
at async main (/app/turtle/build/server.js:66:13)
If we notice the above logs, it can be seen that the issue is mostly pertaining to the Splash screen.
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:8: error: package expo.modules.splashscreen does not exist
[stderr] import expo.modules.splashscreen.SplashScreenImageResizeMode;
[stderr] ^
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:25: error: cannot find symbol
[stderr] public static SplashScreenImageResizeMode SPLASH_SCREEN_IMAGE_RESIZE_MODE = SplashScreenImageResizeMode.CONTAIN;
[stderr] ^
[stderr] symbol: class SplashScreenImageResizeMode
[stderr] location: class AppConstants
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:25: error: cannot find symbol
[stderr] public static SplashScreenImageResizeMode SPLASH_SCREEN_IMAGE_RESIZE_MODE = SplashScreenImageResizeMode.CONTAIN;
[stderr] ^
[stderr] symbol: variable SplashScreenImageResizeMode
[stderr] location: class AppConstants
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:53: error: cannot access SplashScreenImageResizeMode
[stderr] constants.SPLASH_SCREEN_IMAGE_RESIZE_MODE = SPLASH_SCREEN_IMAGE_RESIZE_MODE;
[stderr] ^
[stderr] class file for expo.modules.splashscreen.SplashScreenImageResizeMode not found
[stderr] 4 errors
> Task :app:compileReleaseJavaWithJavac FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:compileReleaseJavaWithJavac'.
[stderr] > Compilation failed; see the compiler error output for details.
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 35s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
Here's my app.json
{
"expo": {
"name": "APP_NAME",
"slug": "APP_SLUG",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "BUNDLE_IDENTIFIER"
},
"android": {
"package": "APP_PACKAGE",
"softwareKeyboardLayoutMode": "pan",
"versionCode": 1,
"permissions": [
"CAMERA"
],
"enableDangerousExperimentalLeanBuilds": true
}
}
}
The builds were successful with the older SDK version, but few packages were not compatible with the older SDK, hence I had to upgrade it to the latest. The application is running perfectly fine in the expo go mobile application, but unable to build a standalone app.
How to solve this problem? Or, is it possible to downgrade from SDK 41 to 40 or 39? Any suggestions or recommendation is appreciated.
There are two major reasons for this cause.
Setting enableDangerousExperimentalLeanBuils to true.
Missing expo-splash-screen package.
The error is because it's(Gradle build) looking for expo-modules-splashscreen package, which is supposedly moved out of expo's main module in SDK 41, hence needs to be separately installed.
In order to fix this, there are two workarounds:
Remove enableDangerousExperimentalLeanBuilds property. (Not tested)
Install expo-splash-screen using npm install expo-splash-screen.(Tested and working)
Related
I'm trying to build an expo app using command "eas build -p android" and got the error like this:
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
[stderr] > Android resource compilation failed
[stderr] ERROR:/home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/assets_images_bgbanner.png: AAPT: error: file failed to compile.
[stderr]
[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] java.lang.StackOverflowError (no error message)
[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 6m 56s
here is my app.json file:
{
"expo": {
"name": "eworkbook-mobile",
"slug": "eworkbook-mobile",
"version": "1.0.0",
"orientation": "portrait",
"userInterfaceStyle": "light",
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.hatieudao.eworkbook"
},
"android": {
"package": "com.hatieudao.eworkbook",
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"extra": {
"eas": {
"projectId": "38e1dc19-4d84-4060-xxxx-xxxxxxxxxxx"
}
},
"plugins": [
[
"expo-build-properties",
{
"android": {
"compileSdkVersion": 31,
"targetSdkVersion": 31,
"buildToolsVersion": "31.0.0"
},
"ios": {
"deploymentTarget": "13.0"
}
}
]
]
}
}
I dont know what to do with the error since I can't find the file "assets_images_bgbanner.png" or "bgbanner.png" anywhere in my project folder. In the asset folder there is just 4 images: adaptive-icon.png,favicon.png,icon.png,splash.png (just default expo images). Maybe the "assets_images_bgbanner.png" is the default image when build on cloud? If so how can I get rid off it or is there any way to fix this error?
I've tried to create my own "bgbanner.png" and put it in the asset folder, but the error is still the same
Ok, I found it. It's "bg-banner.png" not "bgbanner.png". Moreover, the file seem corrupted or something. I tried to open it with paint and save it. It's work.
I want to upgrade my project gradle version from 6.1.1 to 7.0.0 and above, but when I upgrade anything above 6.9 I get errors and cannot find the problem.
Them message it gives me is this:
> Configure project :core
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
> Configure project {name}
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
It will be removed in version 5.0 of the Android Gradle plugin.
> Task :core:preBuild UP-TO-DATE
> Task :core:preDebugBuild UP-TO-DATE
> Task :core:compileDebugAidl NO-SOURCE
> Task :core:compileDebugRenderscript NO-SOURCE
> Task :core:generateDebugBuildConfig UP-TO-DATE
> Task :core:generateDebugResValues UP-TO-DATE
> Task :core:generateDebugResources UP-TO-DATE
> Task :core:packageDebugResources UP-TO-DATE
> Task :core:parseDebugLocalResources UP-TO-DATE
> Task :core:processDebugManifest UP-TO-DATE
> Task :core:generateDebugRFile UP-TO-DATE
> Task :core:kaptGenerateStubsDebugKotlin UP-TO-DATE
> Task :core:kaptDebugKotlin UP-TO-DATE
> Task :core:compileDebugKotlin UP-TO-DATE
> Task :core:javaPreCompileDebug UP-TO-DATE
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:compileDebugJavaWithJavac'.
> Failed to query the value of task ':core:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
> Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, {direcory}
org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#cea20b4) before task ':core:compileDebugJavaWithJavac' has completed is not supported
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':core:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.resolve(DefaultTaskProperties.java:74)
at org.gradle.execution.plan.LocalTaskNode.resolveMutations(LocalTaskNode.java:202)
at org.gradle.execution.plan.DefaultExecutionPlan.getResolvedMutationInfo(DefaultExecutionPlan.java:654)
at org.gradle.execution.plan.DefaultExecutionPlan.selectNext(DefaultExecutionPlan.java:577)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$executeNextNode$1(DefaultPlanExecutor.java:166)
at org.gradle.internal.resources.DefaultResourceLockCoordinationService.withStateLock(DefaultResourceLockCoordinationService.java:45)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:155)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to query the value of task ':core:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:136)
at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValueNoProducer(AbstractProperty.java:121)
at org.gradle.api.internal.file.DefaultFilePropertyFactory$AbstractFileVar.access$100(DefaultFilePropertyFactory.java:180)
at org.gradle.api.internal.file.DefaultFilePropertyFactory$AbstractFileVar$2.calculateOwnValue(DefaultFilePropertyFactory.java:263)
at org.gradle.api.internal.provider.AbstractMinimalProvider.getOrNull(AbstractMinimalProvider.java:93)
at org.gradle.api.internal.tasks.properties.FileParameterUtils.resolveOutputFilePropertySpecs(FileParameterUtils.java:115)
at org.gradle.api.internal.tasks.properties.GetOutputFilesVisitor.visitOutputFileProperty(GetOutputFilesVisitor.java:44)
at org.gradle.api.internal.tasks.properties.CompositePropertyVisitor.visitOutputFileProperty(CompositePropertyVisitor.java:64)
at org.gradle.api.internal.tasks.properties.annotations.AbstractOutputPropertyAnnotationHandler.visitPropertyValue(AbstractOutputPropertyAnnotationHandler.java:50)
at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode.visitProperties(AbstractNestedRuntimeBeanNode.java:56)
at org.gradle.api.internal.tasks.properties.bean.NestedRuntimeBeanNode.visitNode(NestedRuntimeBeanNode.java:41)
at org.gradle.api.internal.tasks.properties.DefaultPropertyWalker.visitProperties(DefaultPropertyWalker.java:41)
at org.gradle.api.internal.tasks.TaskPropertyUtils.visitProperties(TaskPropertyUtils.java:44)
at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.resolve(DefaultTaskProperties.java:65)
at org.gradle.execution.plan.LocalTaskNode.resolveMutations(LocalTaskNode.java:202)
at org.gradle.execution.plan.DefaultExecutionPlan.getResolvedMutationInfo(DefaultExecutionPlan.java:654)
at org.gradle.execution.plan.DefaultExecutionPlan.selectNext(DefaultExecutionPlan.java:577)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$executeNextNode$1(DefaultPlanExecutor.java:166)
at org.gradle.internal.resources.DefaultResourceLockCoordinationService.withStateLock(DefaultResourceLockCoordinationService.java:45)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:155)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.InvalidUserCodeException: Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory,{directory} org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#cea20b4) before task ':core:compileDebugJavaWithJavac' has completed is not supported
at org.gradle.api.internal.provider.TransformBackedProvider.lambda$beforeRead$0(TransformBackedProvider.java:84)
at org.gradle.api.internal.provider.ValueSupplier$TaskProducer.visitContentProducerTasks(ValueSupplier.java:136)
at org.gradle.api.internal.provider.TransformBackedProvider.beforeRead(TransformBackedProvider.java:81)
at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:63)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
at org.gradle.api.internal.provider.MappingProvider.calculateOwnValue(MappingProvider.java:55)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:128)
at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:25)
at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
... 23 more
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
10 actionable tasks: 10 up-to-date
It has multiple libraries, and target and compile SDK is 30. I have tried to update some of the libraries like Hilt, but this does not fixed the issue. It has a lot of deprecated methods, but as I know this usually is not big problem.
SO WHEN I CLICK BUILD PROJECT IT SAYS ZERO ERRORS BUT I STILL GET THIS
Executing tasks: [clean, :unityLibrary:assembleDebug, :launcher:assembleDebug] in
project C:\Users\mehmo\OneDrive\Documents\Game
> Configure project :launcher
WARNING: The option 'android.enableR8' is deprecated and should not be used
anymore.
It will be removed in a future version of the Android Gradle plugin, and will no
longer allow you to disable R8.
> Task :clean UP-TO-DATE
> Task :launcher:clean
> Task :launcher:preBuild UP-TO-DATE
> Task :launcher:preDebugBuild UP-TO-DATE
> Task :launcher:mergeDebugJniLibFolders
> Task :launcher:generateDebugBuildConfig
> Task :launcher:generateDebugResValues
> Task :launcher:mergeDebugNativeLibs
> Task :launcher:stripDebugDebugSymbols
> Task :launcher:copyDebugJniLibsProjectAndLocalJars
> Task :launcher:mergeDebugShaders
> Task :launcher:compileDebugShaders
> Task :launcher:generateDebugAssets
> Task :launcher:packageDebugAssets
> Task :launcher:packageDebugRenderscript NO-SOURCE
> Task :launcher:prepareLintJarForPublish UP-TO-DATE
> Task :launcher:processDebugJavaRes NO-SOURCE
> Task :launcher:processDebugManifest
> Task :launcher:mergeDebugJavaResource
> Task :unityLibrary:clean
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:preDebugBuild UP-TO-DATE
> Task :unityLibrary:compileDebugAidl NO-SOURCE
> Task :launcher:compileDebugAidl NO-SOURCE
> Task :unityLibrary:BuildIl2CppTask
Building libil2cpp.so with AndroidToolChain
Output directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\src\main\jniLibs\armeabi-v7a
Cache directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\il2cpp_armeabi-v7a_Release\il2cpp_cache
ObjectFiles: 221 of which compiled: 221
Time Compile: 12829 milliseconds Lump_libil2cpp_vm.cpp
Time Compile: 12407 milliseconds Il2CppInvokerTable.cpp
Time Compile: 11982 milliseconds Unity.TextMeshPro2.cpp
Time Compile: 11898 milliseconds Generics1.cpp
Time Compile: 11286 milliseconds Generics.cpp
Time Compile: 10922 milliseconds Unity.TextMeshPro3.cpp
Time Compile: 10625 milliseconds mscorlib4.cpp
Time Compile: 9856 milliseconds Unity.TextMeshPro4.cpp
Time Compile: 9713 milliseconds Lump_libil2cpp_icalls.cpp
Time Compile: 8830 milliseconds Generics10.cpp
Total compilation time: 56052 milliseconds.
Total link time: 2164 milliseconds.
Cleaned up 0 object files.
Building libil2cpp.so with AndroidToolChain
Output directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\src\main\jniLibs\arm64-v8a
Cache directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\il2cpp_arm64-v8a_Release\il2cpp_cache
ObjectFiles: 221 of which compiled: 221
Time Compile: 12777 milliseconds Lump_libil2cpp_vm.cpp
Time Compile: 11706 milliseconds Il2CppInvokerTable.cpp
Time Compile: 11465 milliseconds Generics1.cpp
Time Compile: 11200 milliseconds Unity.TextMeshPro2.cpp
Time Compile: 10710 milliseconds Generics.cpp
Time Compile: 10155 milliseconds Unity.TextMeshPro3.cpp
Time Compile: 9667 milliseconds Lump_libil2cpp_icalls.cpp
Time Compile: 9315 milliseconds mscorlib4.cpp
Time Compile: 9026 milliseconds Unity.TextMeshPro4.cpp
Time Compile: 8415 milliseconds Generics3.cpp
Total compilation time: 54646 milliseconds.
Total link time: 3373 milliseconds.
Cleaned up 0 object files.
> Task :unityLibrary:mergeDebugJniLibFolders
> Task :unityLibrary:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:generateDebugBuildConfig
> Task :unityLibrary:generateDebugResValues
> Task :unityLibrary:generateDebugResources
> Task :unityLibrary:packageDebugResources
> Task :unityLibrary:parseDebugLocalResources
> Task :unityLibrary:mergeDebugShaders
> Task :unityLibrary:compileDebugShaders
> Task :unityLibrary:generateDebugAssets
> Task :unityLibrary:packageDebugAssets
> Task :unityLibrary:packageDebugRenderscript NO-SOURCE
> Task :launcher:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
> Task :launcher:generateDebugResources
> Task :unityLibrary:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:processDebugManifest
> Task :unityLibrary:javaPreCompileDebug
> Task :launcher:packageDebugResources
> Task :launcher:parseDebugLocalResources
> Task :unityLibrary:mergeDebugNativeLibs
> Task :unityLibrary:stripDebugDebugSymbols
> Task :unityLibrary:copyDebugJniLibsProjectAndLocalJars
> Task :unityLibrary:mergeDebugJavaResource
> Task :unityLibrary:generateDebugRFile
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
Failed to query the value of task ':unityLibrary:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\generated\ap_generated_sources\debug\out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#35383760) before task ':unityLibrary:compileDebugJavaWithJavac' has completed is not supported
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 59s
34 actionable tasks: 31 executed, 3 up-to-date
IN DEBUG I GET THIS:
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to query the value of task ':unityLibrary:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\generated\ap_generated_sources\debug\out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#4ece53fe) before task ':unityLibrary:compileDebugJavaWithJavac' has completed is not supported
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
2021-05-19T16:15:40.481+0100 [WARN] [org.gradle.internal.featurelifecycle.LoggingDeprecatedFeatureHandler]
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.1/userguide/command_line_interface.html#sec:command_line_warnings
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 2m 1s
I encountered this issue as well and decided to scrap my entire project and do a clean setup. Turns out that Gradle 7.x is incompatible with Android development. If you downgrade your Gradle to 6.9 everything works as expected.
This would explain also why "Build Project" works, but through Gradle it doesn't, it's a different wrapper instance.
Changing the Gradle version of distributionUrl in gradle-wrapper.properties file works for me.
I'm now using Unity 2021.3.5f1 version. From here (https://docs.unity3d.com/Manual/android-gradle-overview.html), I know that I should use Gradle version 6.1.1.
To change the Gradle version, open gradle-wrapper.properties file, update distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip with the Gradle version found above. Then, sync and rebuild the project. Build success!
Hope it would help you!
While following the Detox [installation tutorial for android][1], I had the following error running the detox build -c android.emu.debug
❯ detox build -c android.emu.debug detox[23052] INFO: [build.js] cd android && ./gradlew assembleDebug assembleAndroidTest
-DtestBuildType=debug && cd ..
Task :app:generatePackageList
Task :app:preBuild
Task :react-native-gesture-handler:preBuild UP-TO-DATE
Task :react-native-gesture-handler:preDebugBuild UP-TO-DATE
Task :react-native-gesture-handler:checkDebugManifest UP-TO-DATE
Task :react-native-gesture-handler:processDebugManifest UP-TO-DATE
Task :react-native-reanimated:preBuild UP-TO-DATE
Task :react-native-reanimated:preDebugBuild UP-TO-DATE
Task :react-native-reanimated:checkDebugManifest UP-TO-DATE
Task :react-native-reanimated:processDebugManifest UP-TO-DATE
Task :react-native-screens:preBuild UP-TO-DATE
Task :react-native-screens:preDebugBuild UP-TO-DATE
Task :react-native-screens:checkDebugManifest UP-TO-DATE
Task :react-native-screens:processDebugManifest UP-TO-DATE
Task :react-native-vector-icons:preBuild UP-TO-DATE
Task :react-native-vector-icons:preDebugBuild UP-TO-DATE
Task :react-native-vector-icons:checkDebugManifest UP-TO-DATE
Task :react-native-vector-icons:processDebugManifest UP-TO-DATE
Task :react-native-webview:preBuild UP-TO-DATE
Task :react-native-webview:preDebugBuild UP-TO-DATE
Task :react-native-webview:checkDebugManifest UP-TO-DATE
Task :react-native-webview:processDebugManifest UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :react-native-screens:compileDebugAidl NO-SOURCE
Task :react-native-vector-icons:compileDebugAidl NO-SOURCE
Task :react-native-gesture-handler:compileDebugAidl NO-SOURCE
Task :react-native-reanimated:compileDebugAidl NO-SOURCE
Task :react-native-webview:compileDebugAidl NO-SOURCE
Task :app:compileDebugAidl NO-SOURCE
Task :react-native-gesture-handler:packageDebugRenderscript NO-SOURCE
Task :react-native-reanimated:packageDebugRenderscript NO-SOURCE
Task :react-native-screens:packageDebugRenderscript NO-SOURCE
Task :react-native-vector-icons:packageDebugRenderscript NO-SOURCE
Task :react-native-webview:packageDebugRenderscript NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:checkDebugManifest UP-TO-DATE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:bundleDebugJsAndAssets SKIPPED
Task :app:prepareLintJar UP-TO-DATE
Task :app:generateDebugSources UP-TO-DATE
Task :react-native-gesture-handler:generateDebugBuildConfig UP-TO-DATE
Task :react-native-gesture-handler:compileDebugRenderscript NO-SOURCE
Task :react-native-gesture-handler:generateDebugResValues UP-TO-DATE
Task :react-native-gesture-handler:generateDebugResources UP-TO-DATE
Task :react-native-gesture-handler:prepareLintJar UP-TO-DATE
Task :react-native-gesture-handler:generateDebugSources UP-TO-DATE
Task :react-native-gesture-handler:javaPreCompileDebug UP-TO-DATE
Task :react-native-gesture-handler:packageDebugResources UP-TO-DATE
Task :react-native-gesture-handler:generateDebugRFile UP-TO-DATE
> Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java:4:
error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java:17:
error: cannot find symbol #ReactModule(name =
RNGestureHandlerRootViewManager.REACT_CLASS) ^ symbol: class
ReactModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:16:
error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:19:
error: cannot find symbol import com.facebook.react.uimanager.UIBlock;
^ symbol: class UIBlock location: package com.facebook.react.uimanager
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:40:
error: cannot find symbol
#ReactModule(name=RNGestureHandlerModule.MODULE_NAME) ^ symbol:
class ReactModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java:218:
error: cannot find symbol #ReactProp(name = ViewProps.BORDER_RADIUS)
^ symbol: variable BORDER_RADIUS location: class ViewProps
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:41:
error: method init in class Event cannot be applied to given types;
super.init(handler.getView().getId());
^ required: int,long found: int reason: actual and formal argument lists differ in length where T is a type-variable:
T extends Event declared in class Event /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java:45:
error: cannot find symbol
return parent.getChildAt(((ReactViewGroup) parent).getZIndexMappedChildIndex(index));
^ symbol: method getZIndexMappedChildIndex(int) location: class ReactViewGroup
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java:54:
error: cannot find symbol
String overflow = ((ReactViewGroup) view).getOverflow();
^ symbol: method getOverflow() location: class ReactViewGroup
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:574:
error: cannot find symbol
final int rootViewTag = uiManager.resolveRootTagFromReactTag(ancestorViewTag);
^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type
UIManagerModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:582:
error: cannot find symbol
if (root.getRootView().getRootViewTag() == rootViewTag) {
^ symbol: method getRootViewTag() location: class ReactRootView
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:598:
error: cannot find symbol
uiManager.addUIBlock(new UIBlock() {
^ symbol: class UIBlock location: class RNGestureHandlerModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:634:
error: cannot find symbol
int rootViewTag = uiManager.resolveRootTagFromReactTag(viewTag);
^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type
UIManagerModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:641:
error: cannot find symbol
if (root.getRootView().getRootViewTag() == rootViewTag) {
^ symbol: method getRootViewTag() location: class ReactRootView
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerPackage.java:18:
error: RNGestureHandlerPackage is not abstract and does not override
abstract method createJSModules() in ReactPackage public class
RNGestureHandlerPackage implements ReactPackage {
^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:45:
error: method init in class Event cannot be applied to given types;
super.init(handler.getView().getId());
^ required: int,long found: int reason: actual and formal argument lists differ in length where T is a type-variable:
T extends Event declared in class Event Note: /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java
uses or overrides a deprecated API. Note: Recompile with
-Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for
details. 16 errors
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':react-native-gesture-handler:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output 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
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 6.0. Use '--warning-mode all' to show the
individual deprecation warnings. See
https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5s 22 actionable tasks: 2 executed, 20 up-to-date
detox[23052] ERROR: [cli.js] Error: Command failed: cd android &&
./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug &&
cd ..
"react": "16.8.6",
"react-native": "0.60.5",
"detox": "^14.3.2",
"mocha": "^6.2.0",
Does anyone know how to solve ?
I solved it by changing the order of the maven repositories in android/build.gradle. My allprojects looks like this:
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")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
// All of Detox' artifacts are provided via the npm module
url "$rootDir/../node_modules/detox/Detox-android"
}
maven { url 'https://www.jitpack.io' }
}
}
Thanks to gypsicoder
https://github.com/software-mansion/react-native-gesture-handler/issues/1002
At first I could build and install the app on my Android device but as I launched it crashed, the Logcat was saying that a Firebase library was not included in the package and advising to use the Play Services Jar Resolver. So I used it.
Now I have this error when trying to build my app. (excuse me, I had some issues understanding how to insert a code snippet :) )
CommandInvokationFailure: Gradle build failed.
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -classpath "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-2.14.jar" org.gradle.launcher.GradleMain "assembleRelease"
stderr[
/Users/andreamarchetti/Desktop/Squarcuit/Temp/gradleOut/src/main/AndroidManifest.xml:4: Error: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="false" android:isGame="true" android:banner="#drawable/app_banner">
Explanation for issues of type "HardcodedDebugMode":
It's best to leave out the android:debuggable attribute from the manifest.
If you do, then the tools will automatically insert android:debuggable=true
when building an APK to debug on an emulator or device. And when you
perform a release build, such as Exporting APK, it will automatically set
it to false.
If on the other hand you specify a specific value in the manifest file,
then the tools will always use it. This can lead to accidentally publishing
your app with debug information.
1 errors, 0 warnings
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:591)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:546)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:528)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
]
stdout[
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:preDebugBuild UP-TO-DATE
:Firebase:preBuild UP-TO-DATE
:Firebase:preReleaseBuild UP-TO-DATE
:Firebase:compileReleaseNdk UP-TO-DATE
:Firebase:compileLint
:Firebase:copyReleaseLint UP-TO-DATE
:Firebase:mergeReleaseProguardFiles
:Firebase:packageReleaseRenderscript UP-TO-DATE
:Firebase:checkReleaseManifest
:Firebase:prepareReleaseDependencies
:Firebase:compileReleaseRenderscript
:Firebase:generateReleaseResValues
:Firebase:generateReleaseResources
:Firebase:packageReleaseResources
:Firebase:compileReleaseAidl
:Firebase:generateReleaseBuildConfig
:Firebase:mergeReleaseShaders
:Firebase:compileReleaseShaders
:Firebase:generateReleaseAssets
:Firebase:mergeReleaseAssets
:Firebase:processReleaseManifest
:Firebase:processReleaseResources
:Firebase:generateReleaseSources
:Firebase:incrementalReleaseJavaCompilationSafeguard
:Firebase:compileReleaseJavaWithJavac
:Firebase:processReleaseJavaRes UP-TO-DATE
:Firebase:transformResourcesWithMergeJavaResForRelease
:Firebase:transformClassesAndResourcesWithSyncLibJarsForRelease
:Firebase:mergeReleaseJniLibFolders
:Firebase:transformNative_libsWithMergeJniLibsForRelease
:Firebase:transformNative_libsWithSyncJniLibsForRelease
:Firebase:bundleRelease
:prepareAnimatedVectorDrawable2340Library
:prepareAppcompatV72340Library
:prepareCardviewV72340Library
:prepareCustomtabs2340Library
:prepareFacebookAndroidSdk4170Library
:prepareFacebookAndroidWrapper794Library
:prepareFirebaseAppUnity401Library
:prepareFirebaseCommon1100Library
:prepareFirebaseIid1100Library
:prepareFirebaseMessaging1100Library
:prepareFirebaseMessagingUnity401Library
:prepareGradleOutFirebaseUnspecifiedLibrary
:preparePlayServicesBase1100Library
:preparePlayServicesBasement1100Library
:preparePlayServicesTasks1100Library
:prepareSupportCompat2520Library
:prepareSupportCoreUi2520Library
:prepareSupportCoreUtils2520Library
:prepareSupportFragment2520Library
:prepareSupportMediaCompat2520Library
:prepareSupportV42340Library
:prepareSupportV42520Library
:prepareSupportVectorDrawable2340Library
:prepareReleaseDependencies
:compileReleaseAidl
:compileReleaseRenderscript
:generateReleaseBuildConfig
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:mergeReleaseAssets
:generateReleaseResValues
:generateReleaseResources
:mergeReleaseResources
:processReleaseManifest
:processReleaseResources
:generateReleaseSources
:incrementalReleaseJavaCompilationSafeguard
:compileReleaseJavaWithJavac
:compileReleaseNdk UP-TO-DATE
:compileReleaseSources
:lintVitalRelease
:prePackageMarkerForRelease
:transformClassesWithDexForRelease
To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
:transformClassesWithDexForRelease FAILED
BUILD FAILED
Total time: 45.841 secs
]
exit code: 1
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.GradleWrapper.RunJava (System.String args, System.String workingdir, UnityEditor.Android.Progress progress)
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, UnityEditor.Android.Progress progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.HostView:OnGUI()
I do not have - android:debuggable="false" -anywhere in any AndroidManifest.xml in my project.
I think the problem was that I had multiple .aar files of the same package but different versions. So Facebook SDK was conflicting with some Google Firebase stuff. I deleted the Facebook SDK .aar (which were older versions).