React native Execution failed for task ‘:app:createBundleReleaseJsAndAssets’

I want to release my react native app to Google play store after upgrading it to new SDK but I am facing a problem in releasing it in AAB format. I am able to run my app in the emulator but not when i ran npx react-native build-android --mode=release as stated in the documentation.

Error

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Starting Metro Bundler
warning: Bundler cache is empty, rebuilding (this may take a minute)
Error: Unable to resolve module .index.js from C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppView/.: .index.js could not be found within the project or in these directories:
> Task :app:createBundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createBundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1
error Failed to build the app.
Error: Command failed with exit code 1: gradlew.bat app:bundleRelease
at makeError (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidnode_modulesexecaliberror.js:60:11)
at module.exports.sync (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidnode_modulesexecaindex.js:194:17)
at build (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidbuildcommandsbuildAndroidindex.js:68:22)
at Object.buildAndroid [as func] (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidbuildcommandsbuildAndroidindex.js:60:10)
at Command.handleAction ...
</code>
<code>Starting Metro Bundler warning: Bundler cache is empty, rebuilding (this may take a minute) Error: Unable to resolve module .index.js from C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppView/.: .index.js could not be found within the project or in these directories: > Task :app:createBundleReleaseJsAndAssets FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:createBundleReleaseJsAndAssets'. > Process 'command 'cmd'' finished with non-zero exit value 1 error Failed to build the app. Error: Command failed with exit code 1: gradlew.bat app:bundleRelease at makeError (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidnode_modulesexecaliberror.js:60:11) at module.exports.sync (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidnode_modulesexecaindex.js:194:17) at build (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidbuildcommandsbuildAndroidindex.js:68:22) at Object.buildAndroid [as func] (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidbuildcommandsbuildAndroidindex.js:60:10) at Command.handleAction ... </code>
Starting Metro Bundler
warning: Bundler cache is empty, rebuilding (this may take a minute)
Error: Unable to resolve module .index.js from C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppView/.: .index.js could not be found within the project or in these directories:       

> Task :app:createBundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:createBundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1
   
error Failed to build the app.
Error: Command failed with exit code 1: gradlew.bat app:bundleRelease
    at makeError (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidnode_modulesexecaliberror.js:60:11)
    at module.exports.sync (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidnode_modulesexecaindex.js:194:17)
    at build (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidbuildcommandsbuildAndroidindex.js:68:22)
    at Object.buildAndroid [as func] (C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewnode_modules@react-native-communitycli-platform-androidbuildcommandsbuildAndroidindex.js:60:10)
    at Command.handleAction ...

I do have my index.js file in the directory C:UsersuserDocumentsmadeeasyfinalMadeEasyLearningAppViewindex.js so not sure what went wrong

What i have done

  1. react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res then ./gradlew assembleRelease -x bundleReleaseJsAndAssets but I am getting Task 'bundleReleaseJsAndAssets' not found in root project

  2. Disabled the enabledHermes but it still doesnt work as well

I would appreciate any help with this matter. Thank you in advance

New contributor

Baconpancake002 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật