MetaMask / MetaMask/metamask-mobile

APK build issue

Open
#3,635 0 comments 0 reactions 0 assignees View on GitHub
community
Dominant language
TypeScript
Stars
3k
Forks
1.7k
Avg merge
1d 14h
Merged PRs (30d)
669

Description

Hi I am new to the project and i am getting following errors while building APK

i have genrated Keystore and have followed all the steps in documentation

shreyash@shreyash-TUF-Gaming-FX505DV-FX505DV:~/Desktop/beats1/metamask/android$ ./gradlew assembleRelease
Starting a Gradle Daemon, 3 incompatible and 1 stopped Daemons could not be reused, use --status for details

> Configure project :@react-native-community_blur
WARNING: The option setting 'android.disableResourceValidation=true' is experimental.
The current default is 'false'.

> Configure project :exodus_react-native-payments
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

> Configure project :lottie-react-native
publishNonDefault is deprecated and has no effect anymore. All variants are now published.

> Configure project :react-native-aes-crypto-forked
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

> Configure project :react-native-i18n
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

> Configure project :react-native-os
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

> Configure project :ReactAndroid
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.0.1.
Android SDK Build Tools 29.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.0.1.
Android SDK Build Tools 29.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :@react-native-community_blur:compileReleaseJavaWithJavac
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Welcome to React Native!
Learn once, write anywhere

transform[stderr]: Browserslist: caniuse-lite is outdated. Please run:
transform[stderr]: npx browserslist@latest --update-db
transform[stderr]:
transform[stderr]: Why you should do it regularly:
transform[stderr]: https://github.com/browserslist/browserslist#browsers-data-updating
transform[stderr]: Browserslist: caniuse-lite is outdated. Please run:
transform[stderr]: npx browserslist@latest --update-db
transform[stderr]:
transform[stderr]: Why you should do it regularly:
transform[stderr]: https://github.com/browserslist/browserslist#browsers-data-updating
Error: Unable to resolve module stream from /home/shreyash/Desktop/beats1/metamask/node_modules/create-hash/node_modules/cipher-base/index.js: stream could not be found within the project.

error Unable to resolve module stream from /home/shreyash/Desktop/beats1/metamask/node_modules/create-hash/node_modules/cipher-base/index.js: stream could not be found within the project.
If you are sure the module exists, try these steps:

1. Clear watchman watches: watchman watch-del-all
If you are sure the module exists, try these steps:
2. Delete node_modules and run yarn install
1. Clear watchman watches: watchman watch-del-all
3. Reset Metro's cache: yarn start --reset-cache
2. Delete node_modules and run yarn install
4. Remove the cache: rm -rf /tmp/metro-*
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
1 | var Buffer = require('safe-buffer').Buffer
1 | var Buffer = require('safe-buffer').Buffer
> 2 | var Transform = require('stream').Transform
> 2 | var Transform = require('stream').Transform
| ^
| ^
3 | var StringDecoder = require('string_decoder').StringDecoder
3 | var StringDecoder = require('string_decoder').StringDecoder
4 | var inherits = require('inherits')
4 | var inherits = require('inherits')
5 |
5 |. Run CLI with --verbose flag for more details.
at ModuleResolver.resolveDependency (/home/shreyash/Desktop/beats1/metamask/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:191:15)
at DependencyGraph.resolveDependency (/home/shreyash/Desktop/beats1/metamask/node_modules/metro/src/node-haste/DependencyGraph.js:353:43)
at Object.resolve (/home/shreyash/Desktop/beats1/metamask/node_modules/metro/src/lib/transformHelpers.js:271:42)
at resolve (/home/shreyash/Desktop/beats1/metamask/node_modules/metro/src/DeltaBundler/traverseDependencies.js:571:33)
at /home/shreyash/Desktop/beats1/metamask/node_modules/metro/src/DeltaBundler/traverseDependencies.js:587:26
at Array.reduce ()
at resolveDependencies (/home/shreyash/Desktop/beats1/metamask/node_modules/metro/src/DeltaBundler/traverseDependencies.js:586:33)
at /home/shreyash/Desktop/beats1/metamask/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
at Generator.next ()
at asyncGeneratorStep (/home/shreyash/Desktop/beats1/metamask/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)

> Task :app:bundleReleaseJsAndAssets FAILED

> Task :app:bundleReleaseJsAndAssets_SentryUpload_790 FAILED
Error: spawn /home/shreyash/Desktop/beats1/metamask/node_modules/@sentry/cli/sentry-cli ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /home/shreyash/Desktop/beats1/metamask/node_modules/@sentry/cli/sentry-cli',
path: '/home/shreyash/Desktop/beats1/metamask/node_modules/@sentry/cli/sentry-cli',
spawnargs: [
'--log-level',
'debug',
'react-native',
'gradle',
'--bundle',
'/home/shreyash/Desktop/beats1/metamask/android/app/build/generated/assets/react/release/index.android.bundle',
'--sourcemap',
'/home/shreyash/Desktop/beats1/metamask/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map',
'--release',
'io.metamask@3.6.0+790',
'--dist',
'790'
]
}

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1

* 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:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload_790'.
> Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

* 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 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 50s
27 actionable tasks: 9 executed, 18 up-to-date

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with ./gradlew assembleRelease from the android directory. Read the :app:bundleReleaseJsAndAssets and :app:bundleReleaseJsAndAssets_SentryUpload_790 errors, especially the missing stream module and @sentry/cli executable. Done means the release APK build completes without either task failing.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, node.js, react-native, typescript
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.