GithubHelp home page GithubHelp logo

shakebugs / shake-react-native Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 0.0 5.88 MB

Bug reporting SDK for React Native apps.

Home Page: https://shakebugs.com

Java 32.54% JavaScript 47.40% Starlark 0.88% Swift 0.05% Ruby 1.75% C 0.05% Objective-C 17.33%
bug-reporting react-native-sdk shake-sdk bug-reports react-native sdk debugging

shake-react-native's Introduction

Shake React Native SDK

npm version

React Native plugin for bug reporting.

Features

Feature Available
Bug reporting
Crash reporting
Users

Requirements

Platform Version
React Native 0.56
Android 5.0
iOS 12.0

How to use

Install Shake

Execute the npm install command in your terminal:

npm install @shakebugs/react-native-shake

Install pods from the project root directory:

cd ios && pod install && cd ..

Start Shake

Call Shake.start() method in the index.js file.

import {AppRegistry} from 'react-native';
import App from './src/App';
import {name as appName} from './app.json';
import Shake from '@shakebugs/react-native-shake';

AppRegistry.registerComponent(appName, () => App);

Shake.start('client-id', 'client-secret');

Replace client-id and client-secret with the actual values you have in your workspace settings.

Troubleshooting

If you get the following error during the build time:

Execution failed for task ':app:mergeDexDebug'.

You should set multiDexEnabled flag in app-level build.gradle like below:

defaultConfig {
    applicationId "com.shakebugs.react.example"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "1.0.0"
    multiDexEnabled true
}

Resources

shake-react-native's People

Contributors

big-toni avatar brunoblazincdecode avatar mstanic-shake avatar ncvetko avatar sgrahovar-decode avatar smislav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

shake-react-native's Issues

Crashes on iOS

Crashlytics log:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x9cb4 __exceptionPreprocess
1  libobjc.A.dylib                0x183d0 objc_exception_throw
2  CoreFoundation                 0x17eab8 +[NSObject(NSObject) _copyDescription]
3  CoreFoundation                 0x200e8 ___forwarding___
4  CoreFoundation                 0x86900 _CF_forwarding_prep_0
5  Shake                          0xf7aa8 (Missing UUID 1bcebc1001bc3155926f947f695b5c25)
6  Shake                          0x95fc (Missing UUID 1bcebc1001bc3155926f947f695b5c25)
7  Shake                          0x94b4 (Missing UUID 1bcebc1001bc3155926f947f695b5c25)
8  GasBuddy                       0xd81234 -[RNShake log::] + 233 (RNShake.m:233)
9  CoreFoundation                 0x72c04 __invoking___
10 CoreFoundation                 0x20cb4 -[NSInvocation invoke]
11 CoreFoundation                 0x206cc -[NSInvocation invokeWithTarget:]
12 GasBuddy                       0x5e13b4 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 587 (RCTModuleMethod.mm:587)
13 GasBuddy                       0x5e3598 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 196 (RCTNativeModule.mm:196)
14 GasBuddy                       0x5e3220 invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 419 (Optional.h:419)
15 libdispatch.dylib              0x2320 _dispatch_call_block_and_release
16 libdispatch.dylib              0x3eac _dispatch_client_callout
17 libdispatch.dylib              0x126a4 _dispatch_main_queue_drain
18 libdispatch.dylib              0x122f4 _dispatch_main_queue_callback_4CF
19 CoreFoundation                 0x98c28 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
20 CoreFoundation                 0x7a560 __CFRunLoopRun
21 CoreFoundation                 0x7f3ec CFRunLoopRunSpecific
22 GraphicsServices               0x135c GSEventRunModal
23 UIKitCore                      0x39cf58 -[UIApplication _run]
24 UIKitCore                      0x39cbbc UIApplicationMain
25 GasBuddy                       0xacac main + 8 (main.m:8)
26 ???                            0x1e9778dec (Missing)

And we are at the latest version 16.1.0:

  "@shakebugs/react-native-shake": ^16.1.0

Push notifications crash: Firebase + Shake

We are currently experiencing some issues with our app, after integrating Shake. We noticed that whenever a user receives a push notification (both foreground and quit state), the application crashes. Here is a stack trace for the crash:

Crashed: com.apple.main-thread
0  CoreFoundation                 0x84260 CFAllocatorAllocate + 4
1  CoreFoundation                 0x87168 __CFStringChangeSizeMultiple + 628
2  CoreFoundation                 0x8157c __CFStringAppendBytes + 840
3  CoreFoundation                 0x5100c __CFStringAppendFormatCore + 9656
4  CoreFoundation                 0x841d4 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 184
5  CoreFoundation                 0x80aac _CFStringCreateWithFormatAndArgumentsAux2 + 44
6  Foundation                     0x1aeb8 +[NSString stringWithFormat:] + 68
7  --------------                  0x10d770 +[FIRMessagingLogger formatMessageCode:] + 32 (FIRMessagingLogger.m:32)
8  --------------                  0x10d7bc -[FIRMessagingLogger logFuncDebug:messageCode:msg:] + 41 (FIRMessagingLogger.m:41)
9  --------------                  0x10b680 +[FIRMessagingContextManagerService isContextManagerMessage:] + 72 (FIRMessagingContextManagerService.m:72)
10 --------------                  0x1026ac -[FIRMessaging appDidReceiveMessage:] + 368 (FIRMessaging.m:368)
11 --------------                  0x1108d4 FCMSwizzleWillPresentNotificationWithHandler + 479 (FIRMessagingRemoteNotificationsProxy.m:479)
12 --------------                  0x18d580 -[RNFBMessagingUNUserNotificationCenter userNotificationCenter:willPresentNotification:withCompletionHandler:] + 100 (RNFBMessaging+UNUserNotificationCenter.m:100)
13 Shake                          0xc93bc -[SHKNotificationProxy userNotificationCenter:willPresentNotification:withCompletionHandler:] + 308
14 --------------                  0x1108f0 FCMSwizzleWillPresentNotificationWithHandler + 482 (FIRMessagingRemoteNotificationsProxy.m:482)
15 UIKitCore                      0x3fa9f8 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 175400
16 UIKitCore                      0x209d2c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 308
17 UIKitCore                      0x209ad0 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 4363831536
18 UIKitCore                      0x209910 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 175400
19 FrontBoardServices             0x3ac8 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 308
20 FrontBoardServices             0x3904 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 4363831536
21 FrontBoardServices             0x7120 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 175400
22 FrontBoardServices             0x703c __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 308
23 libdispatch.dylib              0x3eac _dispatch_client_callout + 4363831536
24 libdispatch.dylib              0x791c _dispatch_block_invoke_direct + 175400
25 FrontBoardServices             0x1124c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 308
26 FrontBoardServices             0x10de8 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 4363831536
27 FrontBoardServices             0x13694 -[FBSSerialQueue _performNextFromRunLoopSource] + 175400
28 CoreFoundation                 0xd3128 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 308
29 CoreFoundation                 0xdf7b4 __CFRunLoopDoSource0 + 4363831536
30 CoreFoundation                 0x645e8 __CFRunLoopDoSources0 + 175400
31 CoreFoundation                 0x7a0d4 __CFRunLoopRun + 308
32 CoreFoundation                 0x7f3ec CFRunLoopRunSpecific + 4363831536
33 GraphicsServices               0x135c GSEventRunModal + 175400
34 UIKitCore                      0x39cf58 -[UIApplication _run] + 308
35 UIKitCore                      0x39cbbc UIApplicationMain + 4363831536
36 --------------                  0x620c main + 8 (main.m:8)
37 ???                            0x1c5f38dec -[SHKNotificationProxy userNotificationCenter:willPresentNotification:withCompletionHandler:] + 308

Is there something we're missing in the setup? I'd really appreciate it if we could resolve this soon, as it has a really high impact on our product.

Thank you!

App Hanging when received new notification

After install shake and implemented initial of it, App Hanging when received new notification from Firebase in active App state.
In background and inactive states is working fine, but when app is in active state, App hanging!

My XCODE return this from debug:
EXC_BAD_ACCESS

__52-[FIRMessagingRmqManager querySyncMessageWithRmqID:]_block_invoke

#app_hanging
#firebase
#crash

App stop rotate screen (change orientation) when screen recording is on

My app has a lot flows when it change orientation (from portrait to landscape and back) and I found that during screen recoding from ShakeBugs app no longer rotate the screen.
For orientation change I am using expo-screen-orientation
Android not affected. Only iOS

@shakebugs/react-native-shake" 16.2.1
react-native: 0.71.8
Platform: iOS

[BUG] Use maven-publish to support React Native 0.67 > 0.68

Description

The maven plugin has been deprecated since gradle 6.0 and was removed in gradle 7.0.

React Native 0.68.0 uses gradle 7.3.3

Upgrade the library to use maven-publish so it works with gradle 7.X and React Native 0.67 / 0.68

Test code and steps to reproduce

Install the library in a project that has "react-native": "0.67.0" or major version

Example Reference

https://github.com/software-mansion/react-native-reanimated/pull/2881/files

Patch-package

I've made a patch that you can use if you need to use the library.
( I know it's not perfect but it works )

diff --git a/node_modules/@shakebugs/react-native-shake/android/build.gradle b/node_modules/@shakebugs/react-native-shake/android/build.gradle
index d3a8ea1..fd3e6af 100644
--- a/node_modules/@shakebugs/react-native-shake/android/build.gradle
+++ b/node_modules/@shakebugs/react-native-shake/android/build.gradle
@@ -22,7 +22,7 @@ def safeExtGet(prop, fallback) {
 }
 
 apply plugin: 'com.android.library'
-apply plugin: 'maven'
+apply plugin: 'maven-publish'
 
 buildscript {
     // The Android Gradle plugin is only required when opening the android folder stand-alone.
@@ -45,9 +45,6 @@ rootProject.allprojects {
     }
 }
 
-apply plugin: 'com.android.library'
-apply plugin: 'maven'
-
 android {
     compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
     buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
@@ -55,7 +52,7 @@ android {
         minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
         targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
         versionCode 1
-        versionName "1.0"
+        versionName '1.0'
     }
     lintOptions {
         abortOnError false
@@ -79,7 +76,7 @@ repositories {
 dependencies {
     //noinspection GradleDynamicVersion
     implementation 'com.facebook.react:react-native:+'  // From node_modules
-    api "com.shakebugs:shake:15.0.+"
+    api 'com.shakebugs:shake:15.0.+'
 }
 
 def configureReactNativePom(def pom) {
@@ -88,7 +85,7 @@ def configureReactNativePom(def pom) {
         name packageJson.title
         artifactId packageJson.name
         version = packageJson.version
-        group = "com.shakebugs.react"
+        group = 'com.shakebugs.react'
         description packageJson.description
         url packageJson.repository.baseUrl
 
@@ -112,20 +109,20 @@ def configureReactNativePom(def pom) {
 afterEvaluate { project ->
     // some Gradle build hooks ref:
     // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
-    task androidJavadoc(type: Javadoc) {
-        source = android.sourceSets.main.java.srcDirs
-        classpath += files(android.bootClasspath)
-        classpath += files(project.getConfigurations().getByName('compile').asList())
-        include '**/*.java'
-    }
-
-    task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
-        classifier = 'javadoc'
-        from androidJavadoc.destinationDir
-    }
+    // task androidJavadoc(type: Javadoc) {
+    //     source = android.sourceSets.main.java.srcDirs
+    //     classpath += files(android.bootClasspath)
+    //     classpath += files(project.getConfigurations().getByName('compile').asList())
+    //     include '**/*.java'
+    // }
+
+    // task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
+    //     archiveClassifier = 'javadoc'
+    //     from androidJavadoc.destinationDir
+    // }
 
     task androidSourcesJar(type: Jar) {
-        classifier = 'sources'
+        archiveClassifier = 'sources'
         from android.sourceSets.main.java.srcDirs
         include '**/*.java'
     }
@@ -141,15 +138,22 @@ afterEvaluate { project ->
 
     artifacts {
         archives androidSourcesJar
-        archives androidJavadocJar
+    // archives androidJavadocJar
     }
 
     task installArchives(type: Upload) {
-        configuration = configurations.archives
-        repositories.mavenDeployer {
-            // Deploy to react-native-event-bridge/maven, ready to publish to npm
-            repository url: "file://${projectDir}/../android/maven"
-            configureReactNativePom pom
+        publishing {
+            publications {
+                maven(MavenPublication) {
+                    artifact androidSourcesJar
+                }
+            }
         }
+    // configuration = configurations.archives
+    // repositories.mavenDeployer {
+    //     // Deploy to react-native-event-bridge/maven, ready to publish to npm
+    //     repository url: "file://${projectDir}/../android/maven"
+    //     configureReactNativePom pom
+    // }
     }
 }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.