Skip to content

Commit f3ce218

Browse files
authored
Merge pull request #1293 from Instabug/dev
release/13.4.0
2 parents d7db4d7 + 4752078 commit f3ce218

35 files changed

+651
-259
lines changed

.circleci/config.yml

Lines changed: 220 additions & 123 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## [13.4.0](https://github.com/Instabug/Instabug-React-Native/compare/v13.3.0...v13.4.0) (October 2, 2024)
4+
5+
### Added
6+
7+
- Add support for Expo Router navigation tracking ([#1270](https://github.com/Instabug/Instabug-React-Native/pull/1270)).
8+
- Enhance the network interceptor to capture more client error messages ([#1257](https://github.com/Instabug/Instabug-React-Native/pull/1257)).
9+
10+
### Changed
11+
12+
- Bump Instabug iOS SDK to v13.4.2 ([#1285](https://github.com/Instabug/Instabug-React-Native/pull/1285)). See release notes for [13.4.0](https://github.com/Instabug/Instabug-iOS/releases/tag/13.4.0), [13.4.1](https://github.com/Instabug/Instabug-iOS/releases/tag/13.4.1) and [13.4.2](https://github.com/Instabug/Instabug-iOS/releases/tag/13.4.2).
13+
- Bump Instabug Android SDK to v13.4.1 ([#1285](https://github.com/Instabug/Instabug-React-Native/pull/1285)). See release notes for [13.4.0](https://github.com/Instabug/Instabug-Android/releases/tag/v13.4.0) and [13.4.1](https://github.com/Instabug/Instabug-Android/releases/tag/v13.4.1).
14+
15+
### Fixed
16+
17+
- Fix an issue with JavaScript fatal crashes on iOS causing them to be reported as native iOS crashes instead. ([#1290](https://github.com/Instabug/Instabug-React-Native/pull/1290)).
18+
- Correctly resolve the flavor path when uploading sourcemaps on Android. ([#1225](https://github.com/Instabug/Instabug-React-Native/pull/1225)).
19+
- Drop non-error objects reported as crashes since they don't have a stack trace ([#1279](https://github.com/Instabug/Instabug-React-Native/pull/1279)).
20+
- Fix APM network logging on iOS when the response body is missing or empty. ([#1273](https://github.com/Instabug/Instabug-React-Native/pull/1273)).
21+
322
## [13.3.0](https://github.com/Instabug/Instabug-React-Native/compare/v13.2.0...v13.3.0) (August 4, 2024)
423

524
### Added

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ android {
5757
minSdkVersion getExtOrDefault('minSdkVersion').toInteger()
5858
targetSdkVersion getExtOrDefault('targetSdkVersion').toInteger()
5959
versionCode 1
60-
versionName "13.3.0"
60+
versionName "13.4.0"
6161
multiDexEnabled true
6262
ndk {
6363
abiFilters "armeabi-v7a", "x86"

android/native.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project.ext.instabug = [
2-
version: '13.3.0'
2+
version: '13.4.1'
33
]
44

55
dependencies {

android/sourcemaps.gradle

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ gradle.projectsEvaluated {
1313
def start = name.startsWith(prefixes[0]) ? prefixes[0].length() : prefixes[1].length()
1414
def end = name.length() - suffix.length()
1515
def flavor = name.substring(start, end).uncapitalize()
16+
def defaultVersion = getDefaultVersion(flavor)
1617

17-
task.finalizedBy createUploadSourcemapsTask(flavor)
18+
task.finalizedBy createUploadSourcemapsTask(flavor, defaultVersion.name, defaultVersion.code)
1819
}
1920
}
2021

21-
Task createUploadSourcemapsTask(String flavor) {
22+
Task createUploadSourcemapsTask(String flavor, String defaultVersionName, String defaultVersionCode) {
2223
def name = 'uploadSourcemaps' + flavor.capitalize()
2324

2425
// Don't recreate the task if it already exists.
@@ -38,13 +39,7 @@ Task createUploadSourcemapsTask(String flavor) {
3839
try {
3940
def appProject = project(':app')
4041
def appDir = appProject.projectDir
41-
def flavorPath = flavor + (flavor.empty ? '' : '/')
42-
def sourceMapDest = "build/generated/sourcemaps/react/${flavorPath}release/index.android.bundle.map"
43-
def sourceMapFile = new File(appDir, sourceMapDest)
44-
45-
if (!sourceMapFile.exists()) {
46-
throw new InvalidUserDataException("Unable to find source map file at: ${sourceMapFile.absolutePath}")
47-
}
42+
def sourceMapFile = getSourceMapFile(appDir, flavor)
4843

4944
def jsProjectDir = rootDir.parentFile
5045
def instabugDir = new File(['node', '-p', 'require.resolve("instabug-reactnative/package.json")'].execute(null, rootDir).text.trim()).getParentFile()
@@ -53,9 +48,8 @@ Task createUploadSourcemapsTask(String flavor) {
5348
def inferredToken = executeShellScript(tokenShellFile, jsProjectDir)
5449
def appToken = resolveVar('App Token', 'INSTABUG_APP_TOKEN', inferredToken)
5550

56-
def projectConfig = appProject.android.defaultConfig
57-
def versionName = resolveVar('Version Name', 'INSTABUG_VERSION_NAME', "${projectConfig.versionName}")
58-
def versionCode = resolveVar('Version Code', 'INSTABUG_VERSION_CODE', "${projectConfig.versionCode}")
51+
def versionName = resolveVar('Version Name', 'INSTABUG_VERSION_NAME', defaultVersionName)
52+
def versionCode = resolveVar('Version Code', 'INSTABUG_VERSION_CODE', defaultVersionCode)
5953

6054
exec {
6155
def osCompatibility = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c'] : []
@@ -80,6 +74,59 @@ Task createUploadSourcemapsTask(String flavor) {
8074
return provider.get()
8175
}
8276

77+
File getSourceMapFile(File appDir, String flavor) {
78+
def defaultFlavorPath = flavor.empty ? 'release' : "${flavor}Release"
79+
def defaultSourceMapDest = "build/generated/sourcemaps/react/${defaultFlavorPath}/index.android.bundle.map"
80+
def defaultSourceMapFile = new File(appDir, defaultSourceMapDest)
81+
82+
if (defaultSourceMapFile.exists()) {
83+
return defaultSourceMapFile
84+
}
85+
86+
if (flavor.empty) {
87+
throw new InvalidUserDataException("Unable to find source map file at: ${defaultSourceMapFile.absolutePath}.")
88+
}
89+
90+
def fallbackSourceMapDest = "build/generated/sourcemaps/react/${flavor}/release/index.android.bundle.map"
91+
def fallbackSourceMapFile = new File(appDir, fallbackSourceMapDest)
92+
93+
project.logger.info "Unable to find source map file at: ${defaultSourceMapFile.absolutePath}.\n" +
94+
"Falling back to ${fallbackSourceMapFile.absolutePath}."
95+
96+
if (!fallbackSourceMapFile.exists()) {
97+
throw new InvalidUserDataException("Unable to find source map file at: ${fallbackSourceMapFile.absolutePath} either.")
98+
}
99+
100+
return fallbackSourceMapFile
101+
}
102+
103+
/**
104+
* Infers the app version to use in source map upload based on the flavor.
105+
* This is needed since different flavors may have different version codes and names (e.g. version suffixes).
106+
*
107+
* It checks the version for the flavor's variant.
108+
* If no variant is found it falls back to the app's default config.
109+
*
110+
*
111+
* @param flavor The flavor to get the app version for.
112+
* @return A map containing the version code and version name.
113+
*/
114+
Map<String, String> getDefaultVersion(String flavor) {
115+
def appProject = project(':app')
116+
def defaultConfig = appProject.android.defaultConfig
117+
118+
def variants = appProject.android.applicationVariants
119+
120+
// uncapitalize is used to turn "Release" into "release" if the flavor is empty
121+
def variantName = "${flavor}Release".uncapitalize()
122+
def variant = variants.find { it.name.uncapitalize() == variantName }
123+
124+
def versionName = variant?.versionName ?: defaultConfig.versionName
125+
def versionCode = variant?.versionCode ?: defaultConfig.versionCode
126+
127+
return [name: "${versionName}", code: "${versionCode}"]
128+
}
129+
83130
boolean isUploadSourcemapsEnabled() {
84131
def envValue = System.getenv('INSTABUG_SOURCEMAPS_UPLOAD_DISABLE')?.toBoolean()
85132
def defaultValue = true

examples/default/android/app/src/main/java/com/instabug/react/example/RNInstabugExampleReactnativePackage.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
import com.facebook.react.bridge.NativeModule;
77
import com.facebook.react.bridge.ReactApplicationContext;
88
import com.facebook.react.uimanager.ViewManager;
9-
import com.instabug.reactlibrary.RNInstabugAPMModule;
10-
import com.instabug.reactlibrary.RNInstabugBugReportingModule;
11-
import com.instabug.reactlibrary.RNInstabugCrashReportingModule;
12-
import com.instabug.reactlibrary.RNInstabugFeatureRequestsModule;
13-
import com.instabug.reactlibrary.RNInstabugReactnativeModule;
14-
import com.instabug.reactlibrary.RNInstabugRepliesModule;
15-
import com.instabug.reactlibrary.RNInstabugSessionReplayModule;
16-
import com.instabug.reactlibrary.RNInstabugSurveysModule;
179

1810
import java.util.ArrayList;
1911
import java.util.Collections;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"instabug-domain": "api.instabug.com",
3+
"apm-domain": "api-apm.instabug.com"
4+
}

examples/default/android/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,13 @@ allprojects {
2727
maven {
2828
url("$rootDir/../node_modules/detox/Detox-android")
2929
}
30+
31+
maven {
32+
credentials {
33+
username System.getenv("DREAM11_MAVEN_USERNAME")
34+
password System.getenv("DREAM11_MAVEN_PASSWORD")
35+
}
36+
url "https://mvn.instabug.com/nexus/repository/dream-11"
37+
}
3038
}
3139
}

examples/default/ios/InstabugExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
CC3DF8932A1DFC9A003E9914 /* InstabugSurveysTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88B2A1DFC99003E9914 /* InstabugSurveysTests.m */; };
2222
CC3DF8942A1DFC9A003E9914 /* InstabugAPMTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88C2A1DFC99003E9914 /* InstabugAPMTests.m */; };
2323
CC3DF8952A1DFC9A003E9914 /* IBGConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88D2A1DFC9A003E9914 /* IBGConstants.m */; };
24+
CC487A9C2C71FCFC0021F680 /* Instabug.plist in Resources */ = {isa = PBXBuildFile; fileRef = CC487A9B2C71FCFC0021F680 /* Instabug.plist */; };
2425
CCF1E4092B022CF20024802D /* RNInstabugTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CCF1E4082B022CF20024802D /* RNInstabugTests.m */; };
2526
CD36F4707EA1F435D2CC7A15 /* libPods-InstabugExample-InstabugTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AF7A6E02D40E0CEEA833CC4 /* libPods-InstabugExample-InstabugTests.a */; };
2627
F7BF47401EF3A435254C97BB /* libPods-InstabugExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BAED0D0441A708AE2390E153 /* libPods-InstabugExample.a */; };
@@ -64,6 +65,7 @@
6465
CC3DF88B2A1DFC99003E9914 /* InstabugSurveysTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugSurveysTests.m; sourceTree = "<group>"; };
6566
CC3DF88C2A1DFC99003E9914 /* InstabugAPMTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugAPMTests.m; sourceTree = "<group>"; };
6667
CC3DF88D2A1DFC9A003E9914 /* IBGConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IBGConstants.m; sourceTree = "<group>"; };
68+
CC487A9B2C71FCFC0021F680 /* Instabug.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = Instabug.plist; path = InstabugExample/Instabug.plist; sourceTree = "<group>"; };
6769
CCF1E4082B022CF20024802D /* RNInstabugTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNInstabugTests.m; sourceTree = "<group>"; };
6870
DBCB1B1D023646D84146C91E /* Pods-InstabugExample-InstabugTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugExample-InstabugTests.release.xcconfig"; path = "Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests.release.xcconfig"; sourceTree = "<group>"; };
6971
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
@@ -120,6 +122,7 @@
120122
13B07FAE1A68108700A75B9A /* InstabugExample */ = {
121123
isa = PBXGroup;
122124
children = (
125+
CC487A9B2C71FCFC0021F680 /* Instabug.plist */,
123126
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
124127
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
125128
13B07FB51A68108700A75B9A /* Images.xcassets */,
@@ -296,6 +299,7 @@
296299
buildActionMask = 2147483647;
297300
files = (
298301
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
302+
CC487A9C2C71FCFC0021F680 /* Instabug.plist in Resources */,
299303
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
300304
);
301305
runOnlyForDeploymentPostprocessing = 0;
157 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)