This repository was archived by the owner on May 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
This repository was archived by the owner on May 20, 2025. It is now read-only.
UnknownException: Error in getting binary resources modified time in Staging build #2474
Copy link
Copy link
Closed
Labels
Description
Steps to Reproduce
- Build a staging version of an app with RN 0.70.5 and RN-code-push 7.1.0
- Push a code-push update to the Staging channel
- Start the app
Expected Behavior
What you expected to happen?
App loads the new JS version from code-push, ready to install.
Actual Behavior
New JS is not loaded, and the following unhandled exception is shown in the log:
com.microsoft.codepush.react.CodePushUnknownException: Error in getting binary resources modified time
Environment
- react-native-code-push version: 7.1.0
- react-native version: 0.70.5
- iOS/Android/Windows version: Android
- Does this reproduce on a debug build or release build? Staging
This bug was fixed for Release
builds by PR #2337, but not for Staging
builds. I have created a Staging build by following the suggestions here.
When looking at the gradleResValues.xml file as suggested by @Abbondanzo here, you can see the difference:
.../resValues/release/values/gradleResValues.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Automatically generated file. DO NOT MODIFY -->
<!-- Value from build type: release -->
<integer name="react_native_dev_server_port">8081</integer>
<!-- Value from build type: release -->
<integer name="react_native_inspector_proxy_port">8081</integer>
<!-- Value from build type: release -->
<string name="CODE_PUSH_APK_BUILD_TIME" translatable="false">"1680407116417"</string>
<!-- Value from build type: release -->
<string name="bugsnag_release_stage" translatable="false">production</string>
<!-- Value from build type: release -->
<string name="reactNativeCodePush_androidDeploymentKey" translatable="false">"abcxyz"</string>
</resources>
but from
.../resValues/releaseStaging/values/gradleResValues.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
e
<!-- Automatically generated file. DO NOT MODIFY -->
<!-- Value from build type: releaseStaging -->
<integer name="react_native_dev_server_port">8081</integer>
<!-- Value from build type: releaseStaging -->
<integer name="react_native_inspector_proxy_port">8081</integer>
<!-- Value from build type: releaseStaging -->
<string name="bugsnag_release_stage" translatable="false">staging</string>
<!-- Value from build type: releaseStaging -->
<string name="reactNativeCodePush_androidDeploymentKey" translatable="false">"xyzabc"</string>
</resources>
Workaround
Adding the workaround suggested by @Abbondanzo here in my own app/build.gradle fixes the issue.