OS:
_Platform:_
have a error when compile application in release. any idea for this o reference

We are having the same error on the latest version of this library.
> Task :app:bundleBetaServerBetaJsAndAssets_SentryUpload FAILED
Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
error: No such file or directory (os error 2)
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleBetaServerBetaJsAndAssets_SentryUpload'.
> Process 'command '/../node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
When we tried upgrading to the latest version we found that there was an issue with locating the bundle in ${buildDir}/generated/assets/react/${flavorName}/${buildType}/index.android.bundle.map. The real issue is that the bundling can not find the file and throws an: error: No such file or directory (os error 2)
I recommend trying version 0.40.3. The last working version for us is 0.40.3. When we upgraded to 0.41.0 we had the issue again. So for us really, 0.40.3 is the last stable version.
There is definitely an issue with the way this library handles multiple flavors and buildTypes because it does work on a brand new init, but upgrading any project with somewhat intricate buildTypes always fails.
If your app has buildTypes other than the default debug and release and/or flavors, make sure to edit your app/build.gradle and set the bundleIn config property to true for that build type, as noted in the comment in the app/build.gradle.
// whether to bundle JS and assets in another build variant (if configured).
// See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
// The configuration property can be in the following formats
// 'bundleIn${productFlavor}${buildType}'
// 'bundleIn${buildType}'
// bundleInFreeDebug: true,
// bundleInPaidRelease: true,
// bundleInBeta: true,
For example, if you have a build type called "beta", add bundleInBeta: true to the project.ext.react in app/build.gradle:
project.ext.react = [
entryFile: "index.js",
bundleInBeta: true
]
Then in your build logs, you should see the JS and assets bundling task running for that particular build type:
> Task :app:bundleBetaJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, /some/directory/some-app-name/android/app/build/generated/assets/react/beta/index.android.bundle
info Writing sourcemap output to:, /some/directory/some-app-name/android/app/build/generated/assets/react/beta/index.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 17 asset files
info Done copying assets
Hope helps.
@matthewphiong Thanks dude!
in my case i had added, for whatever reason and so the default for release was being ignored opps
project.ext.react = [
bundleInDebug: true
]
I am closing all old issues, please if this is still a problem feel free to revive it.
Also, consider moving to our new SDK @sentry/react-native if it still happens there please open a new issue.
FYI if you have this error and you have just switched to gradle4. Upgrade the package to 1.5.*
Most helpful comment
If your app has
buildTypesother than the defaultdebugandreleaseand/or flavors, make sure to edit yourapp/build.gradleand set thebundleInconfig property to true for that build type, as noted in the comment in theapp/build.gradle.For example, if you have a build type called "beta", add
bundleInBeta: trueto theproject.ext.reactinapp/build.gradle:Then in your build logs, you should see the JS and assets bundling task running for that particular build type:
Hope helps.