After migrating from 0.59.x to 0.60.x export on iOS works perfect, but when I'm trying to run react-native run-android
, it build success, but in emulator app just open and close with message:
App keeps stopping
In console I have just
Starting: Intent { cmp=com.mycompany/.MainActivity }
and it shows cursor again. Without any errors or messages. I updated gradle.properties with
android.enableJetifier=true
android.useAndroidX=true
Also root build.gradle changed classpath for dependencies:
classpath 'com.android.tools.build:gradle:3.3.0'
and in gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
How can I fix that, or just show some error and debug app crashes?
package.json is this:
"dependencies": {
"native-base": "^2.13.8",
"react": "16.6.3",
"react-native": "^0.60.5",
"react-native-gesture-handler": "^1.4.1",
"react-native-svg": "^9.0.7",
"react-native-vector-icons": "^6.2.0",
"react-native-webview": "^7.0.7",
"react-navigation": "^3.0.9",
"react-redux": "^6.0.0",
"redux": "^4.0.1",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0",
"rn-fetch-blob": "^0.10.16"
},
"devDependencies": {
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.0.0",
"jest": "24.0.0",
"jetifier": "^1.6.4",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3",
"react-timer-mixin": "^0.13.4"
},
"jest": {
"preset": "react-native"
}
What I'm missing?
Edit After run gradlew installDebug --stacktrace
I got this response:
07:20:21 V/ddms: execute: running am get-config
07:20:21 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
07:20:21 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Pixel_2_API_28(AVD) - 9' for app:debug
07:20:21 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
07:20:21 D/Device: Uploading file onto device 'emulator-5554'
07:20:21 D/ddms: Reading file permision of /Users/kristian/Documents/Work/Roche/roche-mobile-app/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r--
07:20:21 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
07:20:21 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
07:20:21 V/ddms: execute: returning
07:20:21 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
07:20:22 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
07:20:22 V/ddms: execute: returning
Installed on 1 device.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings
Error post from adb logcat
09-20 19:51:02.507 6478 6478 I MicroDetectionWorker: onReady
09-20 19:51:02.508 2061 2294 D EGL_emulation: eglMakeCurrent: 0xebc05600: ver 3 0 (tinfo 0xebc03d10)
09-20 19:51:02.509 6478 16903 I MicrophoneInputStream: mic_close SR : 16000 CC : 16 SO : 6
09-20 19:51:02.509 6478 17179 I MicroRecognitionRunner: Detection finished
09-20 19:51:02.509 6478 17179 W ErrorReporter: reportError [type: 211, code: 524300]: Error reading from input stream
09-20 19:51:02.510 6478 6546 I MicroRecognitionRunner: Stopping hotword detection.
09-20 19:51:02.510 6478 17179 W ErrorProcessor: onFatalError, processing error from engine(4)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: com.google.android.apps.gsa.shared.speech.b.g: Error reading from input stream
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.staticplugins.microdetection.d.k.a(SourceFile:91)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.staticplugins.microdetection.d.l.run(Unknown Source:14)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.libraries.gsa.runner.a.a.b(SourceFile:32)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.libraries.gsa.runner.a.c.call(Unknown Source:4)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.shared.util.concurrent.b.g.run(Unknown Source:4)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at java.lang.Thread.run(Thread.java:764)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.shared.util.concurrent.b.i.run(SourceFile:6)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.speech.audio.Tee.j(SourceFile:103)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.speech.audio.au.read(SourceFile:2)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at java.io.InputStream.read(InputStream.java:101)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.speech.audio.ao.run(SourceFile:17)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at com.google.android.apps.gsa.speech.audio.an.run(SourceFile:2)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
09-20 19:51:02.510 6478 17179 W ErrorProcessor: ... 10 more
09-20 19:51:02.510 6478 17179 I AudioController: internalShutdown
09-20 19:51:02.512 6478 14804 I DeviceStateChecker: DeviceStateChecker cancelled
Finally found a way how to fix this issue.
STEP 1
First unlink all stuffs
react-native unlink ...
Then remove node_modules and update native-base
, react-native
, react-native-gesture-handler
, rn-fetch-blob
to latest versions ( if you have them in package.json ). Install jetifier
library. Then install node modules again and then run
react-native link
STEP 2
After that on build.graddle under android folder, change
classPath 'com.android.tools.build:gradle:3.2.1'
into
classPath 'com.android.tools.build:gradle:3.3.0'
And under allprojects/repositories change
repositories {
mavenLocal()
google()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
into
repositories {
mavenLocal()
maven {
url "$rootDir/../node_modules/react-native/android"
}
maven {
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
}
IMPORTANT - order of stuffs must be changed!
STEP 3
Then next step is to add new lines into gradle.properties
android.useDeprecatedNdk=true
android.enableJetifier=true
android.useAndroidX=true
STEP 4 change build.gradle in android/app folder, under definitions add new line:
def useIntlJsc = false
Under android block above defaultConfig add theese lines:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
And under dependencies add those lines:
if (useIntlJsc) {
implementation 'org.webkit:android-jsc-intl:+'
} else {
implementation 'org.webkit:android-jsc:+'
}
Try this method (For android)
cd into android folder
run gradlew clean
or ./gradlew clean
according to your OS
Now run react-native run-android
it worked for me in android.
Try this method (For ios)
For iOS try deleting pods folder and pod install
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.