Skip to content

Commit 6a6b6e7

Browse files
committed
Fix stacktrace order on android
Fixes #131 - iOS 8 crash
1 parent 503d377 commit 6a6b6e7

File tree

9 files changed

+3437
-127
lines changed

9 files changed

+3437
-127
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
33

44
android {
55
compileSdkVersion 23
6-
buildToolsVersion '23.0.1'
6+
buildToolsVersion '25.0.0'
77

88
defaultConfig {
99
minSdkVersion 16

android/src/main/java/io/sentry/RNSentryModule.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,18 @@ private static SentryStackTraceElement[] convertToNativeStacktrace(ReadableNativ
336336
continue;
337337
}
338338

339+
// We remove the url and add native code the method name so its in the stacktrace
340+
// but not
341+
if (calculatedFileName.equals("[native code]")) {
342+
finalFileName = new StringBuilder("");
343+
methodName = new StringBuilder("[native code] ").append(methodName).toString();
344+
}
345+
339346
SentryStackTraceElement stackFrame = new SentryStackTraceElement("", methodName, stackFrameToModuleId(frame), lineNumber, column, finalFileName.toString(), "javascript");
340347
frames.add(stackFrame);
341348
}
342349
SentryStackTraceElement[] synthStackTrace = new SentryStackTraceElement[frames.size()];
343-
Iterator<SentryStackTraceElement> iterator = frames.iterator();
350+
Iterator<SentryStackTraceElement> iterator = frames.descendingIterator();
344351
int i = 0;
345352
while (iterator.hasNext()) {
346353
synthStackTrace[i] = iterator.next();

examples/ReactNativeExample/android/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
buildscript {
44
repositories {
55
jcenter()
6+
mavenLocal()
7+
mavenCentral()
8+
maven {
9+
url "/Users/haza/Projects/sentry-java/gradle/build/repo"
10+
}
611
}
12+
713
dependencies {
814
classpath 'com.android.tools.build:gradle:2.3.3'
915
// NOTE: Do not place your application dependencies here; they belong

examples/ReactNativeExample/ios/ReactNativeExample.xcodeproj/project.pbxproj

Lines changed: 6 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@
1212
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
1313
00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
1414
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
15-
00E356F31AD99517003FC87E /* ReactNativeExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactNativeExampleTests.m */; };
1615
133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
1716
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
1817
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
1918
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
2019
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
2120
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2221
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
23-
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
2422
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
2523
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
24+
63B158FC1EFBF476001E0535 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B158FB1EFBF476001E0535 /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
2625
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
2726
8C44FB5926B54E818A892A25 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 2030FF38C5C7479A9E3F72F3 /* libz.tbd */; };
2827
C0D5AD675F9445918A2A5F71 /* libRNSentry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D1D4EF2667C40A491FCA3A2 /* libRNSentry.a */; };
@@ -64,13 +63,6 @@
6463
remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
6564
remoteInfo = RCTVibration;
6665
};
67-
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
68-
isa = PBXContainerItemProxy;
69-
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
70-
proxyType = 1;
71-
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
72-
remoteInfo = ReactNativeExample;
73-
};
7466
139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
7567
isa = PBXContainerItemProxy;
7668
containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
@@ -254,7 +246,6 @@
254246
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = "<group>"; };
255247
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = "<group>"; };
256248
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = "<group>"; };
257-
00E356EE1AD99517003FC87E /* ReactNativeExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReactNativeExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
258249
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
259250
00E356F21AD99517003FC87E /* ReactNativeExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeExampleTests.m; sourceTree = "<group>"; };
260251
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
@@ -271,23 +262,17 @@
271262
389218E3ED8B4610A9B360F1 /* RNSentry.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNSentry.xcodeproj; path = "../node_modules/react-native-sentry/ios/RNSentry.xcodeproj"; sourceTree = "<group>"; };
272263
3D1D4EF2667C40A491FCA3A2 /* libRNSentry.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNSentry.a; sourceTree = "<group>"; };
273264
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
265+
63B158FB1EFBF476001E0535 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
274266
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
275267
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
276268
/* End PBXFileReference section */
277269

278270
/* Begin PBXFrameworksBuildPhase section */
279-
00E356EB1AD99517003FC87E /* Frameworks */ = {
280-
isa = PBXFrameworksBuildPhase;
281-
buildActionMask = 2147483647;
282-
files = (
283-
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,
284-
);
285-
runOnlyForDeploymentPostprocessing = 0;
286-
};
287271
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
288272
isa = PBXFrameworksBuildPhase;
289273
buildActionMask = 2147483647;
290274
files = (
275+
63B158FC1EFBF476001E0535 /* CoreFoundation.framework in Frameworks */,
291276
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */,
292277
146834051AC3E58100842450 /* libReact.a in Frameworks */,
293278
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
@@ -443,6 +428,7 @@
443428
63AF67B21EDC552500EBCFF7 /* Frameworks */ = {
444429
isa = PBXGroup;
445430
children = (
431+
63B158FB1EFBF476001E0535 /* CoreFoundation.framework */,
446432
2030FF38C5C7479A9E3F72F3 /* libz.tbd */,
447433
);
448434
name = Frameworks;
@@ -503,32 +489,13 @@
503489
isa = PBXGroup;
504490
children = (
505491
13B07F961A680F5B00A75B9A /* ReactNativeExample.app */,
506-
00E356EE1AD99517003FC87E /* ReactNativeExampleTests.xctest */,
507492
);
508493
name = Products;
509494
sourceTree = "<group>";
510495
};
511496
/* End PBXGroup section */
512497

513498
/* Begin PBXNativeTarget section */
514-
00E356ED1AD99517003FC87E /* ReactNativeExampleTests */ = {
515-
isa = PBXNativeTarget;
516-
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeExampleTests" */;
517-
buildPhases = (
518-
00E356EA1AD99517003FC87E /* Sources */,
519-
00E356EB1AD99517003FC87E /* Frameworks */,
520-
00E356EC1AD99517003FC87E /* Resources */,
521-
);
522-
buildRules = (
523-
);
524-
dependencies = (
525-
00E356F51AD99517003FC87E /* PBXTargetDependency */,
526-
);
527-
name = ReactNativeExampleTests;
528-
productName = ReactNativeExampleTests;
529-
productReference = 00E356EE1AD99517003FC87E /* ReactNativeExampleTests.xctest */;
530-
productType = "com.apple.product-type.bundle.unit-test";
531-
};
532499
13B07F861A680F5B00A75B9A /* ReactNativeExample */ = {
533500
isa = PBXNativeTarget;
534501
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeExample" */;
@@ -558,10 +525,6 @@
558525
LastUpgradeCheck = 610;
559526
ORGANIZATIONNAME = Facebook;
560527
TargetAttributes = {
561-
00E356ED1AD99517003FC87E = {
562-
CreatedOnToolsVersion = 6.2;
563-
TestTargetID = 13B07F861A680F5B00A75B9A;
564-
};
565528
13B07F861A680F5B00A75B9A = {
566529
DevelopmentTeam = 97JCY7859U;
567530
};
@@ -631,7 +594,6 @@
631594
projectRoot = "";
632595
targets = (
633596
13B07F861A680F5B00A75B9A /* ReactNativeExample */,
634-
00E356ED1AD99517003FC87E /* ReactNativeExampleTests */,
635597
);
636598
};
637599
/* End PBXProject section */
@@ -836,13 +798,6 @@
836798
/* End PBXReferenceProxy section */
837799

838800
/* Begin PBXResourcesBuildPhase section */
839-
00E356EC1AD99517003FC87E /* Resources */ = {
840-
isa = PBXResourcesBuildPhase;
841-
buildActionMask = 2147483647;
842-
files = (
843-
);
844-
runOnlyForDeploymentPostprocessing = 0;
845-
};
846801
13B07F8E1A680F5B00A75B9A /* Resources */ = {
847802
isa = PBXResourcesBuildPhase;
848803
buildActionMask = 2147483647;
@@ -867,7 +822,7 @@
867822
);
868823
runOnlyForDeploymentPostprocessing = 0;
869824
shellPath = /bin/sh;
870-
shellScript = "#../node_modules/react-native-sentry/bin/bundle-frameworks\nexport SENTRY_ORG=org\nexport SENTRY_PROJECT=project\nexport SENTRY_AUTH_TOKEN=token\n#export SENTRY_URL=\nexport NODE_BINARY=node\nsentry-cli react-native-xcode ../node_modules/react-native/packager/react-native-xcode.sh";
825+
shellScript = "export SENTRY_ORG=sentry\nexport SENTRY_PROJECT=internal\nexport SENTRY_AUTH_TOKEN=533044fed9f449a4801fbc529fad8dbaa518a8cdf1074c05b5291e93d3583038\nexport SENTRY_URL=http://dgriesser-7b0957b1732f38a5e205.eu.ngrok.io/\nexport NODE_BINARY=node\nsentry-cli react-native-xcode ../node_modules/react-native/packager/react-native-xcode.sh";
871826
};
872827
7F30919BF7F84991BBAB4FDF /* Upload Debug Symbols to Sentry */ = {
873828
isa = PBXShellScriptBuildPhase;
@@ -881,19 +836,11 @@
881836
);
882837
runOnlyForDeploymentPostprocessing = 0;
883838
shellPath = /bin/sh;
884-
shellScript = "export SENTRY_PROPERTIES=sentry.properties\n../node_modules/sentry-cli-binary/bin/sentry-cli upload-dsym";
839+
shellScript = "export SENTRY_ORG=sentry\nexport SENTRY_PROJECT=internal\nexport SENTRY_AUTH_TOKEN=533044fed9f449a4801fbc529fad8dbaa518a8cdf1074c05b5291e93d3583038\nexport SENTRY_URL=http://dgriesser-7b0957b1732f38a5e205.eu.ngrok.io/\n../node_modules/sentry-cli-binary/bin/sentry-cli upload-dsym";
885840
};
886841
/* End PBXShellScriptBuildPhase section */
887842

888843
/* Begin PBXSourcesBuildPhase section */
889-
00E356EA1AD99517003FC87E /* Sources */ = {
890-
isa = PBXSourcesBuildPhase;
891-
buildActionMask = 2147483647;
892-
files = (
893-
00E356F31AD99517003FC87E /* ReactNativeExampleTests.m in Sources */,
894-
);
895-
runOnlyForDeploymentPostprocessing = 0;
896-
};
897844
13B07F871A680F5B00A75B9A /* Sources */ = {
898845
isa = PBXSourcesBuildPhase;
899846
buildActionMask = 2147483647;
@@ -905,14 +852,6 @@
905852
};
906853
/* End PBXSourcesBuildPhase section */
907854

908-
/* Begin PBXTargetDependency section */
909-
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
910-
isa = PBXTargetDependency;
911-
target = 13B07F861A680F5B00A75B9A /* ReactNativeExample */;
912-
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
913-
};
914-
/* End PBXTargetDependency section */
915-
916855
/* Begin PBXVariantGroup section */
917856
13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
918857
isa = PBXVariantGroup;
@@ -926,43 +865,6 @@
926865
/* End PBXVariantGroup section */
927866

928867
/* Begin XCBuildConfiguration section */
929-
00E356F61AD99517003FC87E /* Debug */ = {
930-
isa = XCBuildConfiguration;
931-
buildSettings = {
932-
BUNDLE_LOADER = "$(TEST_HOST)";
933-
GCC_PREPROCESSOR_DEFINITIONS = (
934-
"DEBUG=1",
935-
"$(inherited)",
936-
);
937-
INFOPLIST_FILE = ReactNativeExampleTests/Info.plist;
938-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
939-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
940-
LIBRARY_SEARCH_PATHS = (
941-
"$(inherited)",
942-
"\"$(SRCROOT)/$(TARGET_NAME)\"",
943-
);
944-
PRODUCT_NAME = "$(TARGET_NAME)";
945-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeExample.app/ReactNativeExample";
946-
};
947-
name = Debug;
948-
};
949-
00E356F71AD99517003FC87E /* Release */ = {
950-
isa = XCBuildConfiguration;
951-
buildSettings = {
952-
BUNDLE_LOADER = "$(TEST_HOST)";
953-
COPY_PHASE_STRIP = NO;
954-
INFOPLIST_FILE = ReactNativeExampleTests/Info.plist;
955-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
956-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
957-
LIBRARY_SEARCH_PATHS = (
958-
"$(inherited)",
959-
"\"$(SRCROOT)/$(TARGET_NAME)\"",
960-
);
961-
PRODUCT_NAME = "$(TARGET_NAME)";
962-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeExample.app/ReactNativeExample";
963-
};
964-
name = Release;
965-
};
966868
13B07F941A680F5B00A75B9A /* Debug */ = {
967869
isa = XCBuildConfiguration;
968870
buildSettings = {
@@ -1087,15 +989,6 @@
1087989
/* End XCBuildConfiguration section */
1088990

1089991
/* Begin XCConfigurationList section */
1090-
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeExampleTests" */ = {
1091-
isa = XCConfigurationList;
1092-
buildConfigurations = (
1093-
00E356F61AD99517003FC87E /* Debug */,
1094-
00E356F71AD99517003FC87E /* Release */,
1095-
);
1096-
defaultConfigurationIsVisible = 0;
1097-
defaultConfigurationName = Release;
1098-
};
1099992
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeExample" */ = {
1100993
isa = XCConfigurationList;
1101994
buildConfigurations = (

examples/ReactNativeExample/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"test": "jest"
88
},
99
"dependencies": {
10-
"react": "^16.0.0-alpha.12",
11-
"react-native": "^0.45.0",
10+
"react": "16.0.0-alpha.12",
11+
"react-native": "0.45.1",
1212
"react-native-sentry": "file:../../"
1313
}
1414
}

0 commit comments

Comments
 (0)