触摸已损坏(Android /调试)

时间:2019-06-05 09:48:06

标签: react-native

首先,很抱歉,如果不是很清楚,这是我的第一个要求,而且我不确定有关此类帖子的过程,因此,如果您有任何建议来整理此帖子并使其更加清晰,随时告诉我。

在为我的办公室开发应用程序时,该应用程序突然仅在调试中出现了一个奇怪的错误。 任何触摸或滚动都没有响应,例如冻结:

  • 按钮不起作用,也不显示动画
  • ScrollView ..不要滚动
  • 所有超时和动画以编程方式(带有setTimeout)开始起作用,因此并不是真正的冻结
  • dev菜单有效,我可以切换调试js或检查器
  • 可以切换检查器,但选项卡不响应。轻按组件也无响应。
  • 控制台也不会显示任何异常错误,adb logcat也不会显示

可悲的是,我对android的本机部分不是很熟练,所以我不确定在哪里检查,经过几次搜索后我找不到任何类似的行为,因此欢迎提出任何提示或建议。

尝试过的解决方案和测试:

  • 添加setTimeout以在另一页上导航以检查它是否不冻结=>导航正常,动画也如此
  • 签出先前提交以从sain android config重新编译=>轻触不响应
  • 使用简单的按钮初始化新的应用模板=>该应用示例有效
  • 将js源代码移动到主应用程序=>触摸不响应(我认为这不是源代码的问题,而是配置的问题)
  • 基于发行版(带有自签名证书)=>应用正常

配置:

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

依赖项:

"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"
}

build.gradle的配置:

def enableSeparateBuildPerCPUArchitecture = false
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'
}

0 个答案:

没有答案