react-native icon indicating copy to clipboard operation
react-native copied to clipboard

App Bundle Release isn't building

Open IsaiahTek opened this issue 1 year ago • 1 comments

Description

After I created my project and build bundle release twice, I started encountering this issue of not generating a bundled app for release.

I followed the steps of first cd android Then I do: ./gradlew buildRelease

It finishes without any error but doesn't bundle the app at all

Version

8.0.4

Output of npx react-native info

Fetching system and libraries information... System: OS: Linux 5.15 Deepin 20.6 20.6 CPU: (4) x64 Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz Memory: 6.00 GB / 15.51 GB Shell: 5.0.3 - /bin/bash Binaries: Node: 16.16.0 - ~/.config/nvm/versions/node/v16.16.0/bin/node Yarn: Not Found npm: 8.11.0 - ~/.config/nvm/versions/node/v16.16.0/bin/npm Watchman: 20220821.200817.0 - /usr/local/bin/watchman SDKs: Android SDK: Not Found IDEs: Android Studio: Not Found Languages: Java: 18.0.2 - /home/user/Development/jdk-18.0.2/bin/javac npmPackages: @react-native-community/cli: Not Found react: Not Found react-native: Not Found npmGlobalPackages: react-native: Not Found

NOTE

I have Android Studio installed on my machine and followed the steps to add to PATH as documented in the official react-native website. But when I npx react-native info it keeps giving the Android SDK: Not Found. However, npx react-native start and npx react-native run-android are both working fine and even working with the emulator perfectly.

Steps to reproduce

Create a new app on Deepin 2.6 Try to build bundle (aab) release. If you can build the bundle release (aab) subsequently then help me with how you got that done

Snack, code example, screenshot, or link to a repository

info Writing bundle output to:, /media/user/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/ReactNative Apps/APP/android/app/build/generated/assets/react/release/index.android.bundle info Writing sourcemap output to:, /media/user/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/ReactNative Apps/APP/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map info Done writing bundle output info Done writing sourcemap output

IsaiahTek avatar Aug 23 '22 17:08 IsaiahTek

i have the same problem. npx react-native doctor gives me:

Common
 ✓ Node.js
 ✓ yarn

Android
 ✖ JDK
   - Version found: N/A
   - Version supported: 1.8.x || >= 9
 ✖ Android Studio - Required for building and installing your app on Android
 ✖ Android SDK - Required for building and installing your app on Android
   - Versions found: N/A
   - Version supported: 31.0.0
 ✖ ANDROID_HOME

Errors:   4
Warnings: 0

echo $ANDROID_SDK_ROOT: /home/damian/Android/Sdk

echo $PATH: /home/damian/.nvm/versions/node/v18.7.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/damian/Android/Sdk/emulator:/home/damian/Android/Sdk/platform-toolseval:/home/damian/Android/Sdk/emulator:/home/damian/Android/Sdk/platform-tools

what am i supposed to get?

damian165-cpu avatar Aug 24 '22 22:08 damian165-cpu

I couldn't figure it out so I switched the code base to kotlin.

I may never visit Reactnative anytime soon

IsaiahTek avatar Sep 14 '22 05:09 IsaiahTek

It finishes without any error but doesn't bundle the app at all

Can you clarify what do you mean with 'doesn't bundle the app at all'. The app is bundled in the android/app/build/outputs folder.

Version

8.0.4

Also this is not a React Native version. Can you clarify on which version are you at the moment.

I may never visit Reactnative anytime soon

If you don't need furhter support, please close this issue @IsaiahTek

cortinico avatar Sep 15 '22 13:09 cortinico

It finishes without any error but doesn't bundle the app at all

Can you clarify what do you mean with 'doesn't bundle the app at all'. The app is bundled in the android/app/build/outputs folder.

Version

8.0.4

Also this is not a React Native version. Can you clarify on which version are you at the moment.

I may never visit Reactnative anytime soon

If you don't need furhter support, please close this issue @IsaiahTek

reactnative version in use

As shown in the imagine, the reactnative version is 0.69.3

IsaiahTek avatar Sep 16 '22 07:09 IsaiahTek

It finishes without any error but doesn't bundle the app at all

Can you clarify what do you mean with 'doesn't bundle the app at all'. The app is bundled in the android/app/build/outputs folder.

Version

8.0.4

Also this is not a React Native version. Can you clarify on which version are you at the moment.

I may never visit Reactnative anytime soon

If you don't need furhter support, please close this issue @IsaiahTek

I get it is bundled in the folder android/app/build/outputs folder. That is main issue. When I get into the folder, I can't seem to see the bundled files there. See imagine below for clarification

reactnative outputs folder

IsaiahTek avatar Sep 16 '22 08:09 IsaiahTek

That is main issue. When I get into the folder, I can't seem to see the bundled files there. See imagine below for clarification

Could you share your whole build log from the terminal as a text (not as an image)?

cortinico avatar Sep 16 '22 11:09 cortinico

That is main issue. When I get into the folder, I can't seem to see the bundled files there. See imagine below for clarification

Could you share your whole build log from the terminal as a text (not as an image)?

Here it is

Note: The log below is for the latest ReactNative version (i.e 0.70.1). So even the latest version doesn't build apps for release. It builds for debug.

Moving into the android directory with cd android and building release version with ./gradlew buildRelease gives the following:

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
                Welcome to Metro v0.72.3
              Fast - Scalable - Integrated


info Writing bundle output to:, /media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/intermediates/sourcemaps/react/release/index.android.bundle.packager.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 1 asset files
info Done copying assets
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:2030:23: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow"
        return typeof DebuggerInternal !== 'undefined' && DebuggerInternal.shouldPauseOnThrow === true;
                      ^~~~~~~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:5831:7: warning: the variable "setTimeout" was not declared in function "logCapturedError"
      setTimeout(function () {
      ^~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:4179:23: warning: the variable "clearTimeout" was not declared in anonymous function " 89#"
      cancelTimeout = clearTimeout;
                      ^~~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:8826:30: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in anonymous function " 89#"
  if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:8844:146: warning: the variable "nativeFabricUIManager" was not declared in anonymous function " 118#"
    null != handle._nativeTag && (null != handle._internalInstanceHandle ? (handle = handle._internalInstanceHandle.stateNode, null != handle && nativeFabricUIManager.dispatchCommand(handle.node, command, args)) : _$$_REQUIRE(_dependencyMap[2]).UIManager.dispatchViewManagerCommand(handle._nativeTag, command, args));
                                                                                                                                                 ^~~~~~~~~~~~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:9807:5: warning: the variable "setImmediate" was not declared in function "handleResolved"
    setImmediate(function () {
    ^~~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13343:12: warning: the variable "fetch" was not declared in anonymous function " 290#"
    fetch: fetch,
           ^~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13344:14: warning: the variable "Headers" was not declared in anonymous function " 290#"
    Headers: Headers,
             ^~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13345:14: warning: the variable "Request" was not declared in anonymous function " 290#"
    Request: Request,
             ^~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13346:15: warning: the variable "Response" was not declared in anonymous function " 290#"
    Response: Response
              ^~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13522:24: warning: the variable "FileReader" was not declared in function "readBlobAsArrayBuffer"
      var reader = new FileReader();
                       ^~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13567:36: warning: the variable "Blob" was not declared in anonymous function " 301#"
        } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
                                   ^~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13569:40: warning: the variable "FormData" was not declared in anonymous function " 301#"
        } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
                                       ^~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13571:44: warning: the variable "URLSearchParams" was not declared in anonymous function " 301#"
        } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
                                           ^~~~~~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13848:23: warning: the variable "XMLHttpRequest" was not declared in anonymous function " 310#"
        var xhr = new XMLHttpRequest();
                      ^~~~~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:13355:76: warning: the variable "self" was not declared in anonymous function " 293#"
    var global = typeof globalThis !== 'undefined' && globalThis || typeof self !== 'undefined' && self || typeof global !== 'undefined' && global;
                                                                           ^~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:22407:27: warning: the variable "performance" was not declared in anonymous function " 494#"
  if ("object" === typeof performance && "function" === typeof performance.now) {
                          ^~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:22433:26: warning: the variable "navigator" was not declared in anonymous function " 494#"
  "undefined" !== typeof navigator && undefined !== navigator.scheduling && undefined !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling);
                         ^~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:22513:37: warning: the variable "MessageChannel" was not declared in anonymous function " 494#"
  };else if ("undefined" !== typeof MessageChannel) {
                                    ^~~~~~~~~~~~~~
/media/isaiah/5230AE8E30AE789D/SHARED_STORAGE/DEV-APPS/Mobile Apps/ReactNative Apps/QuizApp/android/app/build/generated/assets/react/release/index.android.bundle:31210:32: warning: the variable "requestAnimationFrame" was not declared in function "onUpdate"
        this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
                               ^~~~~~~~~~~~~~~~~~~~~

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1m

IsaiahTek avatar Sep 16 '22 11:09 IsaiahTek

Moving into the android directory with cd android and building release version with ./gradlew buildRelease gives the following:

The problem is because you're invoking the wrong task.

You should invoke ./gradlew bundleRelease for App bundles and ./gradlew assembleRelease for APKs

cortinico avatar Sep 16 '22 11:09 cortinico

Moving into the android directory with cd android and building release version with ./gradlew buildRelease gives the following:

The problem is because you're invoking the wrong task.

You should invoke ./gradlew bundleRelease for App bundles and ./gradlew assembleRelease for APKs

Is this specific to version 0.70.1 or to all versions?

IsaiahTek avatar Sep 16 '22 11:09 IsaiahTek

Is this specific to version 0.70.1 or to all versions?

Is specific to all versions. It's actually part of the Android framework.

cortinico avatar Sep 16 '22 11:09 cortinico

OK. Thanks

IsaiahTek avatar Sep 16 '22 12:09 IsaiahTek