Javascript 在android中应对本机0.59.9应用程序崩溃
当我登录并在主应用程序中时,应用程序崩溃,但当我在登录屏幕上时,没有出现任何错误,并且几秒钟后应用程序崩溃。IOS运行良好,运行完美 反应本机环境信息: 系统: 操作系统:Windows 10 CPU:(8)x64 Intel(R)Core(TM)i5-8300H CPU@2.30GHz 内存:1.19 GB/7.85 GB 二进制文件: 纱线:1.19.2-C:\ProgramFiles(x86)\Thread\bin\Thread.CMD npm:6.11.2-C:\Program Files\nodejs\npm.CMD package.jsonJavascript 在android中应对本机0.59.9应用程序崩溃,javascript,android,react-native,Javascript,Android,React Native,当我登录并在主应用程序中时,应用程序崩溃,但当我在登录屏幕上时,没有出现任何错误,并且几秒钟后应用程序崩溃。IOS运行良好,运行完美 反应本机环境信息: 系统: 操作系统:Windows 10 CPU:(8)x64 Intel(R)Core(TM)i5-8300H CPU@2.30GHz 内存:1.19 GB/7.85 GB 二进制文件: 纱线:1.19.2-C:\ProgramFiles(x86)\Thread\bin\Thread.CMD npm:6.11.2-C:\Program File
{
"name": "FitnessCapital",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start -- --reset-cache",
"test": "jest",
"postinstall": "sh ./fix.sh"
},
"dependencies": {
"@feathersjs/authentication-client": "^1.0.2",
"@feathersjs/feathers": "^3.1.7",
"@feathersjs/socketio-client": "^1.1.0",
"@react-native-community/slider": "^2.0.0",
"appcenter": "^1.6.0",
"appcenter-analytics": "^1.6.0",
"appcenter-crashes": "^1.6.0",
"axios": "^0.18.0",
"cloudinary": "^1.13.2",
"instabug-reactnative": "^8.3.2",
"mobx": "4.3.1",
"mobx-react": "5.1.0",
"moment": "^2.24.0",
"native-base": "^2.8.0",
"react": "16.8.3",
"react-native": "^0.59.9",
"react-native-amplitude-analytics": "^0.2.6",
"react-native-easy-grid": "^0.2.0",
"react-native-extended-stylesheet": "^0.11.1",
"react-native-fbsdk": "^0.10.0",
"react-native-fetch-blob": "^0.10.8",
"react-native-gifted-chat": "^0.4.3",
"react-native-google-signin": "2.0.0",
"react-native-image-crop-picker": "^0.24.1",
"react-native-image-picker": "^0.27.0",
"react-native-linear-gradient": "^2.5.3",
"react-native-modal": "^6.5.0",
"react-native-navigation": "^1.1.493",
"react-native-permissions": "^1.1.1",
"react-native-progress": "^3.5.0",
"react-native-push-notification": "^3.1.2",
"react-native-share": "^1.2.1",
"react-native-smtp-mailer": "^1.1.8",
"react-native-snap-carousel": "^3.7.5",
"react-native-svg": "^9.4.0",
"react-native-svg-charts": "^5.2.0",
"react-native-swiper": "^1.5.13",
"react-native-vector-icons": "^6.3.0",
"react-native-video": "^4.0.0",
"react-native-view-shot": "^2.6.0",
"react-timer-mixin": "^0.13.4",
"socket.io-client": "^2.1.1",
"victory-native": "^31.0.0"
},
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/plugin-proposal-decorators": "^7.4.4",
"@babel/preset-flow": "^7.0.0",
"@babel/runtime": "^7.4.4",
"babel-eslint": "^8.2.5",
"babel-jest": "^24.8.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-react-native": "^4.0.0",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.1.0",
"eslint-plugin-react": "^7.10.0",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.54.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native",
"setupFiles": [
".\\node_modules\\appcenter\\test\\AppCenterMock.js",
".\\node_modules\\appcenter-analytics\\test\\AppCenterAnalyticsMock.js",
".\\node_modules\\appcenter-crashes\\test\\AppCenterCrashesMock.js"
]
}
}
adroid/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
def versionOverrides = [
"com.facebook.android:facebook-android-sdk": "4.37.0",
]
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
googlePlayServicesAuthVersion = "15.0.1"
}
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
subprojects {
if (project.name.contains('react-native-image-picker')) {
buildscript {
repositories {
jcenter()
maven { url "https://dl.bintray.com/android/android-tools/" }
}
}
}
afterEvaluate {project ->
// force libs to use recent buildtools
if (project.hasProperty("android")) {
android {
compileSdkVersion = 28 // change to match your desired version
buildToolsVersion = "28.0.3" // ....
}
}
}
}
allprojects {
repositories {
google()
jcenter()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven { url "https://jitpack.io" }
maven {
url "https://sdks.instabug.com/nexus/repository/instabug-cp"
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def overrideVersion = versionOverrides[details.requested.group + ":" + details.requested.name]
if (overrideVersion != null && details.requested.version != overrideVersion) {
details.useVersion overrideVersion
}
}
}
}
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
您可以在Android Studio上的Logcat中查看错误详细信息。
如果没有解决此错误的方法,请将其发布在此处,我将尽最大努力帮助您解决此问题大多数情况下,当调试版本正常运行且应用程序崩溃时,发布版本中没有错误,这是由于proguard造成的。在您的android/app/build.gradle上,尝试此设置并构建您发布的应用程序,以测试是否存在这种情况
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
// JUST LEAVE THE ABOVE LINE AND COMMENT EVERYTHING ELSE IN THIS BLOCK
// minifyEnabled enableProguardInReleaseBuilds
// proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
并配置您的proguard。通常,您必须添加以下代码行
-keep class installed.package.identifier.** { *; }
installed.package.identifier是受导致崩溃的proguard影响的包。您需要找出可能是哪个包导致了此错误,并添加其包标识符,以便proguard不会删除所需的类。“getLeaderboardRank错误:无法读取undefined的属性'placedValue'”—我们在IOS上也遇到了此错误,但其工作正常。代码中的某个地方有一个ObjectName.placedValue或类似内容。你能展示那部分代码吗?还有一件事,如果没有解决你的问题,不要接受答案,就像每个人都在传递你的问题,因为它表明问题已经得到了回答