Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue : Touch broken (Android/Debug) #25153

Closed
maxoux opened this issue Jun 5, 2019 · 6 comments
Closed

Issue : Touch broken (Android/Debug) #25153

maxoux opened this issue Jun 5, 2019 · 6 comments
Labels
Platform: Android Android applications. Platform: Linux Building on Linux. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Question Issues that are actually questions and not bug reports.

Comments

@maxoux
Copy link

maxoux commented Jun 5, 2019

Hi everyone !

First, i'm sorry if it's not very clear, it's my first request and i'm not sure about the process about this kind of post, so if you have any recommendations to structure this post and make it more clear, feel free to tell me.

While developping an app for my office, the App suddenly had a weird bug in debug only.
Any touch or scroll not responding, like a freeze :

  • Button not working and don't display animations
  • Scroll.. Don't scroll
  • All timeout and animations programmatically (with setTimeout) started works, so it's not really a freeze
  • The dev menu works and i can toggle debug js, or inspector
  • The inspector can be toggled, but the tab don't respond. A tap on a component don't respond too.
  • The console don't show any unusual error, adb logcat either

Additionnal Informations :

  • App inited with Ignite, and it's worked perfectly for several weeks
  • Use of react-native CodePush
  • Just before this bug i tried to add to build.gradle an applicationIdSuffix to debug config, but even after removing this line the bug occurs

Solutions and Test tried :

  • Add setTimeout to navigate on another page to check if it's not a freeze => navigation works, animations too
  • Checkout previous commit to recompile from sain android config => Touch not respond
  • Init a new app template with a simple button => The app example works
  • Move js source code to main application => Touch not respond (I assume at this point it's not a problem from source code but from the configurations)
  • Build on release (with self signed certificate) => App works

Sadly i'm not very skilled in the native part of android, so i'm not sure where to check and after few searchs i couldn't find any similar behaviors, so any tips or recommendations are welcomes.

Cordially,

Configuration :

  React Native Environment Info:
    System:
      OS: Linux 4.9 Debian GNU/Linux 9 (stretch) 9 (stretch)
      CPU: (6) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
      Memory: 490.10 MB / 9.54 GB
      Shell: 4.4.12 - /bin/bash
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.15.2 - /usr/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
    SDKs:
      Android SDK:
        API Levels: 23, 25, 27, 28
        Build Tools: 27.0.3, 28.0.3
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.3 => 0.59.3 
    npmGlobalPackages:
      react-native-cli: 2.0.1

package.json :

  "name": "xxx",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "clean": "rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean --force",
    "clean:android": "cd android/ && ./gradlew clean && cd .. && react-native run-android",
    "newclear": "rm -rf $TMPDIR/react-* && watchman watch-del-all && rm -rf ios/build && rm -rf node_modules/ && npm cache clean --force && npm i",
    "test:watch": "jest --watch",
    "updateSnapshot": "jest --updateSnapshot",
    "coverage": "jest --coverage && open coverage/lcov-report/index.html || xdg-open coverage/lcov-report/index.html",
    "android:build": "cd android && ./gradlew assembleRelease",
    "android:install": "cd android && ./gradlew assembleRelease && ./gradlew installRelease",
    "android:hockeyapp": "cd android && ./gradlew assembleRelease && puck -submit=auto app/build/outputs/apk/app-release.apk",
    "android:devices": "$ANDROID_HOME/platform-tools/adb devices",
    "android:logcat": "$ANDROID_HOME/platform-tools/adb logcat *:S ReactNative:V ReactNativeJS:V",
    "android:shake": "$ANDROID_HOME/platform-tools/adb devices | grep '\\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} $ANDROID_HOME/platform-tools/adb -s {} shell input keyevent 82",
    "storybook": "storybook start -p 7007",
    "lint": "standard --verbose | snazzy",
    "lintdiff": "git diff --name-only --cached --relative | grep '\\.js$' | xargs standard | snazzy",
    "fixcode": "standard --fix",
    "git-hook": "npm run lint -s && npm run test -s"
  },
  "dependencies": {
    "apisauce": "^1.0.2",
    "appcenter": "1.13.0",
    "appcenter-analytics": "1.13.0",
    "appcenter-crashes": "1.13.0",
    "faker": "^4.1.0",
    "format-json": "^1.0.3",
    "identity-obj-proxy": "^3.0.0",
    "lodash": "^4.17.11",
    "matter-js": "^0.14.2",
    "moment": "^2.24.0",
    "prop-types": "^15.7.2",
    "querystringify": "2.1.0",
    "ramda": "^0.26.1",
    "react": "16.8.3",
    "react-moment-proptypes": "^1.6.0",
    "react-native": "0.59.3",
    "react-native-animatable": "^1.3.2",
    "react-native-canvas": "^0.1.32",
    "react-native-code-push": "^5.6.0",
    "react-native-config": "^0.11.7",
    "react-native-device-info": "^1.6.1",
    "react-native-elements": "^1.1.0",
    "react-native-fs": "^2.13.3",
    "react-native-game-engine": "^0.11.5",
    "react-native-gesture-handler": "^1.0.14",
    "react-native-i18n": "2.0.14",
    "react-native-linear-gradient": "^2.5.4",
    "react-native-open-maps": "^0.3.3",
    "react-native-progress": "^3.6.0",
    "react-native-shadow": "^1.2.2",
    "react-native-svg": "^9.4.0",
    "react-native-vector-icons": "6.1.0",
    "react-navigation": "^3.11.0",
    "react-navigation-redux-helpers": "^2.0.6",
    "react-redux": "^6.0.0",
    "redux": "^4.0.0",
    "redux-persist": "^5.10.0",
    "redux-saga": "^1.0.0",
    "reduxsauce": "1.0.1",
    "seamless-immutable": "^7.1.4"
  },
  "devDependencies": {
    "@babel/core": "^7.4.4",
    "@babel/runtime": "^7.4.4",
    "@storybook/addon-storyshots": "^4.1.11",
    "@storybook/addons": "^4.1.11",
    "@storybook/channels": "^4.1.11",
    "@storybook/react-native": "^4.1.11",
    "@types/faker": "^4.1.5",
    "@types/jest": "^24.0.13",
    "@types/react": "^16.8.17",
    "@types/react-native": "^0.57.55",
    "@types/react-test-renderer": "^16.8.1",
    "babel-core": "6.26.3",
    "babel-eslint": "7.1.1",
    "babel-jest": "^24.8.0",
    "babel-plugin-ignite-ignore-reactotron": "^0.3.0",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react-native": "^4.0.1",
    "enzyme": "^3.2.0",
    "enzyme-adapter-react-16": "^1.1.0",
    "ignite-andross": "^4.0.2",
    "ignite-animatable": "1.0.2",
    "ignite-dev-screens": "2.4.5",
    "ignite-i18n": "1.2.0",
    "ignite-redux-persist": "1.1.2",
    "ignite-standard": "1.0.0",
    "ignite-vector-icons": "1.1.1",
    "jest": "^24.8.0",
    "metro-react-native-babel-preset": "^0.54.0",
    "mockery": "^2.1.0",
    "react-devtools-core": "3.6.0",
    "react-dom": "16.7.0",
    "react-native-typescript-transformer": "^1.2.12",
    "react-test-renderer": "16.8.3",
    "reactotron-react-native": "^2.1.0",
    "reactotron-redux": "^2.1.0",
    "reactotron-redux-saga": "^3.0.0",
    "snazzy": "^8.0.0",
    "standard": "10.0.2",
    "typescript": "^3.4.5"
  },
  "jest": {
    "preset": "react-native",
    "testMatch": [
      "<rootDir>/Tests/**/*.js",
      "**/?(*.)(spec|test).js?(x)"
    ],
    "testPathIgnorePatterns": [
      "/node_modules/",
      "<rootDir>/Tests/Setup.js"
    ],
    "moduleNameMapper": {
      "^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "identity-obj-proxy"
    },
    "transform": {
      "^.+\\.(js)$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
    },
    "setupFiles": [
      "<rootDir>/Tests/Setup"
    ]
  },
  "config": {},
  "standard": {
    "parser": "babel-eslint",
    "globals": [
      "describe",
      "test",
      "jest",
      "expect",
      "fetch",
      "navigator",
      "__DEV__",
      "XMLHttpRequest",
      "FormData",
      "React$Element"
    ]
  },
  "rnpm": {
    "assets": [
      "./assets/fonts"
    ]
  }
}

build.gradle :


import com.android.build.OutputFile

/**
 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
 * and bundleReleaseJsAndAssets).
 * These basically call `react-native bundle` with the correct arguments during the Android build
 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
 * bundle directly from the development server. Below you can see all the possible configurations
 * and their defaults. If you decide to add a configuration block, make sure to add it before the
 * `apply from: "../../node_modules/react-native/react.gradle"` line.
 *
 * project.ext.react = [
 *   // the name of the generated asset file containing your JS bundle
 *   bundleAssetName: "index.android.bundle",
 *
 *   // the entry file for bundle generation
 *   entryFile: "index.android.js",
 *
 *   // whether to bundle JS and assets in debug mode
 *   bundleInDebug: false,
 *
 *   // whether to bundle JS and assets in release mode
 *   bundleInRelease: true,
 *
 *   // whether to bundle JS and assets in another build variant (if configured).
 *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
 *   // The configuration property can be in the following formats
 *   //         'bundleIn${productFlavor}${buildType}'
 *   //         'bundleIn${buildType}'
 *   // bundleInFreeDebug: true,
 *   // bundleInPaidRelease: true,
 *   // bundleInBeta: true,
 *
 *   // whether to disable dev mode in custom build variants (by default only disabled in release)
 *   // for example: to disable dev mode in the staging build type (if configured)
 *   devDisabledInStaging: true,
 *   // The configuration property can be in the following formats
 *   //         'devDisabledIn${productFlavor}${buildType}'
 *   //         'devDisabledIn${buildType}'
 *
 *   // the root of your project, i.e. where "package.json" lives
 *   root: "../../",
 *
 *   // where to put the JS bundle asset in debug mode
 *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
 *
 *   // where to put the JS bundle asset in release mode
 *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in debug mode
 *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in release mode
 *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
 *
 *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
 *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
 *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
 *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
 *   // for example, you might want to remove it from here.
 *   inputExcludes: ["android/**", "ios/**"],
 *
 *   // override which node gets called and with what additional arguments
 *   nodeExecutableAndArgs: ["node"],
 *
 *   // supply additional arguments to the packager
 *   extraPackagerArgs: []
 * ]
 */

project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.xxx"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 7
        versionName "0.6"
    }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    implementation project(':react-native-fs')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-svg')
    implementation project(':react-native-code-push')
    implementation project(':react-native-config')
    implementation project(':appcenter-crashes')
    implementation project(':appcenter-analytics')
    implementation project(':appcenter')
    implementation project(':react-native-device-info')
    implementation project(':react-native-i18n')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-gesture-handler')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}
@maxoux maxoux added the Type: Question Issues that are actually questions and not bug reports. label Jun 5, 2019
@react-native-bot react-native-bot added Platform: Android Android applications. Platform: Linux Building on Linux. labels Jun 5, 2019
@react-native-bot
Copy link
Collaborator

We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

👉 Click here if you want to report a reproducible bug or regression in React Native.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: No Template labels Jun 5, 2019
@vkrenta
Copy link

vkrenta commented Apr 30, 2020

same bug with windows 10 and react-native v0.62

@AricWu
Copy link

AricWu commented May 19, 2020

same bug with macOs and react-native v0.62.2, timer and touch event not working

@weinixuehao
Copy link

@AricWu Me too! Do you have a solution for the issue?

@fabOnReact
Copy link
Contributor

duplicate of #28687

@avinashlng1080
Copy link

me too

@facebook facebook locked as resolved and limited conversation to collaborators Jun 5, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Platform: Linux Building on Linux. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Question Issues that are actually questions and not bug reports.
Projects
None yet
Development

No branches or pull requests

7 participants