Describe the bug
Just upgraded RN to 0.59.2 Getting some wierd behaviour where animations (using react-native's Animated) are no longer triggering when running detox test with mocha
If I kill the detox command and re-launch the IPA that has been installed on the simulator by detox init, animations behave as expected again
Does detox launch the application with a particular set of flags? I've been able to find the launch command with a trace log level
To Reproduce
Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.
yarn detox build to build the binaryyarn detox test to run the testsExpected behavior
On the first run via detox text, the animated text ("This should animate in") should appear
Screenshots
See video recording
Environment (please complete the following information):
Device and Verbose Detox Logs
See here
iOS Framework Build Logs
n/a
What I've found is that when we launch app using Detox code below:
this.gestureX = new Animated.Value(0);
this.gestureY = new Animated.Value(0);
this.gesture = Animated.event(
[
{
nativeEvent: {
translationX: this.gestureX,
translationY: this.gestureY
}
}
],
{
useNativeDriver: true
}
);
results in:
'App -> this.gestureX: ', { _children: [],
_value: 0,
_startingValue: 0,
_offset: 0,
_animation: null,
_listeners: {} }
'App -> this.gestureY: ', { _children: [],
_value: 0,
_startingValue: 0,
_offset: 0,
_animation: null,
_listeners: {} }
'App -> this.gesture: ', null
while running application via react-native run-ios/android, or launching using xCode / Android Studio produces:

So, basically, it is either RN broke something or somethings happens when building application via detox build
I think the detox build command itself isn't the issue
I've noticed SIMCTL_CHILD_DYLD_INSERT_LIBRARIES is used to insert the detox framework when running detox test, before calling /usr/bin/xcrun simctl launch
Running this command by itself (no detox framework) runs the app with animations behaving as expected... So I assume it must be something in the framework that may not be compatible with this version. Am exploring the framework now, will post back any findings
That's strange. RN manages their "native" animations by themselves, and Detox/Earl Grey should not interfere.
Indeed... I've tried to run with some breakpoints to see what's going on, but nothing obvious has surfaced yet
@LeoNatan were you able to reproduce the same results using the above repo?
Sorry, I haven't attempted yet.
I managed to reproduce without even running tests. Simply having Detox attached seems to make the animation not run.
I managed to reproduce without even running tests. Simply having Detox attached seems to make the animation not run.
As @zibs pointed out:
https://github.com/wix/Detox/issues/1207#issuecomment-474083720
This comes because attaching Detox.framework sets Platform.isTesting to true, so essentially no animations work, since they are just mocked not the actual implementation.
Ufff, I see
But how is that property set. I don't remember adding something like that. Must be something in React Native. Investigating.
Ufff, I see
But how is that property set. I don't remember adding something like that. Must be something in React Native. Investigating.
I am not sure, but it from the looks of it:
https://github.com/facebook/react-native/blob/deb2a94568a4b62812cc538960fa1b25e4344dfa/Libraries/Utilities/Platform.ios.js#L42
The value itself is taken from here:
https://github.com/facebook/react-native/blob/95b05c0d8200f50c702637668e32e3a95131fd0a/React/Base/RCTUtils.m#L455
Christ 🤦♂️
Well, Earl Grey brings that dependency.
I'm not sure how to handle this. I could probably swizzle this RN function, but not sure I should be fighting the system here. Sounds like people should open a bug report with Facebook.
This ugly piece of code makes it work:
Class (*__orig_objc_lookUpClass)(const char * name);
Class __dtx_objc_lookUpClass(const char * name)
{
void* nameptr = (void*)name;
void* xctestptr = (void*)"XCTest";
if(name != NULL && (nameptr == xctestptr || memcmp(nameptr, xctestptr, 6) == 0))
{
return nil;
}
return __orig_objc_lookUpClass(name);
}
OK, I'll add this, and I'll add a hidden command line argument if people do not want this new behavior.
Awesome, thanks for finding this so quickly
For the time being, if anyone wants to upgrade RN but not break their detox tests, changing https://github.com/facebook/react-native/blob/deb2a94568a4b62812cc538960fa1b25e4344dfa/Libraries/Utilities/Platform.ios.js#L42 to return false with a postinstall patch is what we've gone for. Definitely not a long term solution.
We will release a version shortly with the fix. I wonder if this will also fix the React Navigation issues.
We will release a version shortly with the fix. I wonder if this will also fix the React Navigation issues.
Most likely it will, since React Navigation depends on Animated to do transitions. But I can check it after new detox release with fix.
There were more than one issue discussed on the comments.
12.1 out.
@LeoNatan Tested on my project its working fine . Thanks! a lot for quick fix .
@LeoNatan OK, animations for Animated are working
React Navigation works as well now:
Hello @LeoNatan do we need to change the command invocation for [email protected]?
@micabe Are you seeing a problem?
Iv got this error @LeoNatan
[karma-mobile] yarn test:e2e:local:test --loglevel verbose 15:42:48 ☁ tech/upgrade-rn-0.59 ☀
yarn run v1.13.0
$ NODE_ENV=local detox test --configuration ios.sim.debug.local --loglevel verbose
detox[1981] WARN: [test.js] Deprecation warning: "file" and "specs" support will be dropped in the next Detox version.
detox[1981] WARN: [test.js] Please edit your package.json according to the migration guide: https://wix.to/I0DOAK0
detox[1981] INFO: [test.js] node_modules/.bin/mocha --opts __tests__/e2e/mocha.opts --configuration ios.sim.debug.local --loglevel verbose --grep :android: --invert --record-logs none --take-screenshots none --record-videos none --artifacts-location "artifacts/ios.sim.debug.local.2019-03-27 15-09-20Z" "__tests__/e2e"
detox[1988] INFO: [DetoxServer.js] server listening on localhost:61628...
detox[1988] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:61628
detox[1988] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=9bb4c787-1683-8851-3d08-4d36929d5d9d
detox[1988] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=9bb4c787-1683-8851-3d08-4d36929d5d9d
detox[1988] DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox[1988] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone 7" --byOS "12.1"
detox[1988] DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone 7...
detox[1988] DEBUG: [exec.js/EXEC_CMD, #2] applesimutils --list --byId "7963D9F1-76E2-4FFB-9845-DE669E27E537"
detox[1988] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl uninstall 7963D9F1-76E2-4FFB-9845-DE669E27E537 com.qare.patient.local
detox[1988] DEBUG: [exec.js/EXEC_TRY, #3] Uninstalling com.qare.patient.local...
detox[1988] DEBUG: [exec.js/EXEC_SUCCESS, #3] com.qare.patient.local uninstalled
detox[1988] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl install 7963D9F1-76E2-4FFB-9845-DE669E27E537 "/Users/qare-macbook/Dev/karma-mobile/ios/build/Build/Products/Debug.local-iphonesimulator/karmaMobile.app"
detox[1988] DEBUG: [exec.js/EXEC_TRY, #4] Installing /Users/qare-macbook/Dev/karma-mobile/ios/build/Build/Products/Debug.local-iphonesimulator/karmaMobile.app...
detox[1988] DEBUG: [exec.js/EXEC_TRY, #4] Installing /Users/qare-macbook/Dev/karma-mobile/ios/build/Build/Products/Debug.local-iphonesimulator/karmaMobile.app...
detox[1988] DEBUG: [exec.js/EXEC_SUCCESS, #4] /Users/qare-macbook/Dev/karma-mobile/ios/build/Build/Products/Debug.local-iphonesimulator/karmaMobile.app installed
detox[1988] DEBUG: [exec.js/EXEC_CMD, #5] /usr/bin/xcrun simctl terminate 7963D9F1-76E2-4FFB-9845-DE669E27E537 com.qare.patient.local
detox[1988] DEBUG: [exec.js/EXEC_TRY, #5] Terminating com.qare.patient.local...
detox[1988] DEBUG: [exec.js/EXEC_SUCCESS, #5] com.qare.patient.local terminated
detox[1988] DEBUG: [exec.js/EXEC_CMD, #6] /bin/cat /dev/null >/Users/qare-macbook/Library/Developer/CoreSimulator/Devices/7963D9F1-76E2-4FFB-9845-DE669E27E537/data/tmp/detox.last_launch_app_log.out 2>/Users/qare-macbook/Library/Developer/CoreSimulator/Devices/7963D9F1-76E2-4FFB-9845-DE669E27E537/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/qare-macbook/Library/Detox/ios/4120085417653d555da1c89c273a816994fdcfff/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 7963D9F1-76E2-4FFB-9845-DE669E27E537 com.qare.patient.local --args -detoxServer ws://localhost:61628 -detoxSessionId 9bb4c787-1683-8851-3d08-4d36929d5d9d
detox[1988] DEBUG: [exec.js/EXEC_TRY, #6] Launching com.qare.patient.local...
detox[1988] INFO: [AppleSimUtils.js] com.qare.patient.local launched. The stdout and stderr logs were recreated, you can watch them with:
tail -F /Users/qare-macbook/Library/Developer/CoreSimulator/Devices/7963D9F1-76E2-4FFB-9845-DE669E27E537/data/tmp/detox.last_launch_app_log.{out,err}
detox[1988] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=9bb4c787-1683-8851-3d08-4d36929d5d9d)
detox[1988] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=9bb4c787-1683-8851-3d08-4d36929d5d9d
detox[1988] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=9bb4c787-1683-8851-3d08-4d36929d5d9d
detox[1988] ERROR: [index.js/DETOX_INIT_ERROR]
Signal 4 was raised
(
0 Detox 0x00000001118d2516 _ZL16__DTXHandleCrashP11NSExceptionP8NSNumberP8NSString + 497
1 Detox 0x00000001118d229b _ZL17__DTXHandleSignali + 61
2 libsystem_platform.dylib 0x000000011adacf5a _sigtramp + 26
3 ??? 0x000000000000000a 0x0 + 10
4 CoreFoundation 0x0000000112d6aaa2 +[NSCalendar initialize] + 34
5 libobjc.A.dylib 0x00000001177e92fe CALLING_SOME_+initialize_METHOD + 19
6 libobjc.A.dylib 0x00000001177e9691 _class_initialize + 270
7 libobjc.A.dylib 0x00000001177f0248 lookUpImpOrForward + 196
8 libobjc.A.dylib 0x00000001177fd814 _objc_msgSend_uncached + 68
9 Detox 0x00000001118c8df8 __dtx_objc_lookUpClass + 87
10 CoreFoundation 0x0000000112d5af8f __CFLookUpClass + 15
11 CoreFoundation 0x0000000112d6aac0 __24+[NSCalendar initialize]_block_invoke + 16
12 libdispatch.dylib 0x000000011a9d854b _dispatch_client_callout + 8
13 libdispatch.dylib 0x000000011a9d9d52 _dispatch_once_callout + 20
14 CoreFoundation 0x0000000112d6aaa2 +[NSCalendar initialize] + 34
15 libobjc.A.dylib 0x00000001177e92fe CALLING_SOME_+initialize_METHOD + 19
16 libobjc.A.dylib 0x00000001177e9691 _class_initialize + 270
17 libobjc.A.dylib 0x00000001177f0248 lookUpImpOrForward + 196
18 libobjc.A.dylib 0x00000001177fd814 _objc_msgSend_uncached + 68
19 karmaMobile 0x00000001105b14f1 +[ADJUtil getDateFormatter] + 97
20 karmaMobile 0x00000001105b19fe +[ADJUtil formatDate:] + 62
21 karmaMobile 0x00000001105b1996 +[ADJUtil formatSeconds1970:] + 86
22 karmaMobile 0x0000000110593dfb +[ADJPackageBuilder parameters:setDate1970:forKey:] + 139
23 karmaMobile 0x0000000110592508 -[ADJPackageBuilder injectCommonParameters:] + 120
24 karmaMobile 0x0000000110591ed8 -[ADJPackageBuilder idsParameters] + 296
25 karmaMobile 0x0000000110591b18 -[ADJPackageBuilder buildAttributionPackage] + 40
26 karmaMobile 0x000000011057d763 -[ADJActivityHandler initI:preLaunchActionsArray:] + 4099
27 karmaMobile 0x00000001105783df __52-[ADJActivityHandler initWithConfig:savedPreLaunch:]_block_invoke_2 + 127
28 karmaMobile 0x00000001105ba0e3 __42+[ADJUtil launchInQueue:selfInject:block:]_block_invoke + 83
29 libdispatch.dylib 0x000000011a9d74e1 _dispatch_call_block_and_release + 12
30 libdispatch.dylib 0x000000011a9d854b _dispatch_client_callout + 8
31 libdispatch.dylib 0x000000011a9df01c _dispatch_lane_serial_drain + 720
32 libdispatch.dylib 0x000000011a9dfb5f _dispatch_lane_invoke + 401
33 libdispatch.dylib 0x000000011a9e89a8 _dispatch_workloop_worker_thread + 645
34 libsystem_pthread.dylib 0x000000011adbdfd2 _pthread_wqthread + 980
35 libsystem_pthread.dylib 0x000000011adbdbe9 start_wqthread + 13
)
1) "before all" hook: _callee
0 passing (40s)
1 failing
1) "before all" hook: _callee:
Error: the string "Signal 4 was raised\n(\n\t0 Detox 0x00000001118d2516 _ZL16__DTXHandleCrashP11NSExceptionP8NSNumberP8NSString + 497\n\t1 Detox 0x00000001118d229b _ZL17__DTXHandleSignali + 61\n\t2 libsystem_platform.dylib 0x000000011adacf5a _sigtramp + 26\n\t3 ??? 0x000000000000000a 0x0 + 10\n\t4 CoreFoundation 0x0000000112d6aaa2 +[NSCalendar initialize] + 34\n\t5 libobjc.A.dylib 0x00000001177e92fe CALLING_SOME_+initialize_METHOD + 19\n\t6 libobjc.A.dylib 0x00000001177e9691 _class_initialize + 270\n\t7 libobjc.A.dylib 0x00000001177f0248 lookUpImpOrForward + 196\n\t8 libobjc.A.dylib 0x00000001177fd814 _objc_msgSend_uncached + 68\n\t9 Detox 0x00000001118c8df8 __dtx_objc_lookUpClass + 87\n\t10 CoreFoundation 0x0000000112d5af8f __CFLookUpClass + 15\n\t11 CoreFoundation 0x0000000112d6aac0 __24+[NSCalendar initialize]_block_invoke + 16\n\t12 libdispatch.dylib 0x000000011a9d854b _dispatch_client_callout + 8\n\t13 libdispatch.dylib 0x000000011a9d9d52 _dispatch_once_callout + 20\n\t14 CoreFoundation 0x0000000112d6aaa2 +[NSCalendar initialize] + 34\n\t15 libobjc.A.dylib 0x00000001177e92fe CALLING_SOME_+initialize_METHOD + 19\n\t16 libobjc.A.dylib 0x00000001177e9691 _class_initialize + 270\n\t17 libobjc.A.dylib 0x00000001177f0248 lookUpImpOrForward + 196\n\t18 libobjc.A.dylib 0x00000001177fd814 _objc_msgSend_uncached + 68\n\t19 karmaMobile 0x00000001105b14f1 +[ADJUtil getDateFormatter] + 97\n\t20 karmaMobile 0x00000001105b19fe +[ADJUtil formatDate:] + 62\n\t21 karmaMobile 0x00000001105b1996 +[ADJUtil formatSeconds1970:] + 86\n\t22 karmaMobile 0x0000000110593dfb +[ADJPackageBuilder parameters:setDate1970:forKey:] + 139\n\t23 karmaMobile 0x0000000110592508 -[ADJPackageBuilder injectCommonParameters:] + 120\n\t24 karmaMobile 0x0000000110591ed8 -[ADJPackageBuilder idsParameters] + 296\n\t25 karmaMobile 0x0000000110591b18 -[ADJPackageBuilder buildAttributionPackage] + 40\n\t26 karmaMobile 0x000000011057d763 -[ADJActivityHandler initI:preLaunchActionsArray:] + 4099\n\t27 karmaMobile 0x00000001105783df __52-[ADJActivityHandler initWithConfig:savedPreLaunch:]_block_invoke_2 + 127\n\t28 karmaMobile 0x00000001105ba0e3 __42+[ADJUtil launchInQueue:selfInject:block:]_block_invoke + 83\n\t29 libdispatch.dylib 0x000000011a9d74e1 _dispatch_call_block_and_release + 12\n\t30 libdispatch.dylib 0x000000011a9d854b _dispatch_client_callout + 8\n\t31 libdispatch.dylib 0x000000011a9df01c _dispatch_lane_serial_drain + 720\n\t32 libdispatch.dylib 0x000000011a9dfb5f _dispatch_lane_invoke + 401\n\t33 libdispatch.dylib 0x000000011a9e89a8 _dispatch_workloop_worker_thread + 645\n\t34 libsystem_pthread.dylib 0x000000011adbdfd2 _pthread_wqthread + 980\n\t35 libsystem_pthread.dylib 0x000000011adbdbe9 start_wqthread + 13\n)" was thrown, throw an Error :)
at process._tickCallback (internal/process/next_tick.js:68:7)
detox[1981] ERROR: [cli.js] Error: Command failed: node_modules/.bin/mocha --opts __tests__/e2e/mocha.opts --configuration ios.sim.debug.local --loglevel verbose --grep :android: --invert --record-logs none --take-screenshots none --record-videos none --artifacts-location "artifacts/ios.sim.debug.local.2019-03-27 15-09-20Z" "__tests__/e2e"
✨ Done in 55.92s.
Seems like a crash. Please open a new issue for this and attach this log.
Is this related SSL pinnning
On Wed, 27 Mar 2019 at 9:21 PM, Leo Natan notifications@github.com wrote:
Seems like a crash. Please open a new issue for this and attach this log.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/wix/Detox/issues/1234#issuecomment-477220641, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AX8BloqA7h1OJkX3443L46PejH8VvxBhks5va5NqgaJpZM4cMSGR
.>
Yogesh Thanvi
QA Team Lead
Punchh Tech India Pvt Ltd
@micabe There is already an issue (#1240), no need to open another one.
Ok thanks for your help @LeoNatan . I really appreciate.
It's already fixed. Please install 12.1.1
Most helpful comment
Fixed in https://github.com/wix/Detox/commit/2507c1e4325936ed9f46c0f64571fa581c71ff5f