Android release APK fails immediately on launch on mobile device - android

The Android release APK crashes on launch when I install it on mobile device. It works fine on Android Emulator. Also, debug builds work fine on Emulator.
I’ve tried the methods in the below link suggested by #bhardman, #gderaco + #sacchykhedkar and #alvelig so far with no success.
https://github.com/facebook/react-native/issues/18357
Environment:
package.json
…
"dependencies": {
"react": "^16.6.3",
"react-dom": "^16.8.1",
"react-native": "0.58.4",
"react-native-gesture-handler": "^1.0.15",
"react-native-image-pan-zoom": "^2.1.11",
"react-navigation": "^3.2.1"
},
…
android/ build.gradle
…
buildscript {
ext {
buildToolsVersion = "28.0.2"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
…
App.js
…
import React, {Component} from 'react';
import { Platform, StyleSheet, Text, View, Image, Dimensions, Button, TouchableHighlight, WebView, ViewPropTypes } from 'react-native';
import { createStackNavigator, createAppContainer, StackActions, NavigationActions, withNavigation } from "react-navigation";
type Props = {};
export class App1 extends Component {
render() {
return (
<View style={styles.container}>
<TopMenu1 navigation={this.props.navigation} />
<View1Map />
</View>
);
}
}
…
Expected behaviour:
You open the app on your mobile device. And the app opens.
Actual behaviour:
App fails to launch on Android phone. Error message:
Unfortunately, [APP Name] had stopped.
Error messages (from logs.txt file generated from the Android phone):
I can't tell which lines are relevant. So I searched with the app name "sampleapp".
02-14 08:12:51.252 1062 1940 I ActivityManager: Killing 26119:com.android.defcontainer/u0a17 (adj 15): empty #17
02-14 08:12:51.260 1062 2363 I ActivityManager: Recipient 26119
02-14 08:12:51.270 1062 1385 I ActivityManager: Recipient 26671
02-14 08:12:51.295 1062 1698 D StatusBarManagerService: swetImeWindowStatus vis=0 backDisposition=0
02-14 08:12:51.341 1062 1940 D PMS : releaseWL(23288de): PARTIAL_WAKE_LOCK *launch* 0x1 WorkSource{10256}
02-14 08:12:51.410 1062 1385 I ActivityManager: Process com.htc.videocenter (pid 26671) has died
02-14 08:12:52.438 26718 26718 E AndroidRuntime: FATAL EXCEPTION: main
02-14 08:12:52.438 26718 26718 E AndroidRuntime: Process: com.sampleapp, PID: 26718
02-14 08:12:52.438 26718 26718 E AndroidRuntime: java.lang.IllegalStateException: Unable to create layer for ReactViewGroup
02-14 08:12:52.438 26718 26718 E AndroidRuntime: at android.os.MessageQueue.nativePollOnce(Native Method)
02-14 08:12:52.438 26718 26718 E AndroidRuntime: at android.os.MessageQueue.next(MessageQueue.java:323)
02-14 08:12:52.438 26718 26718 E AndroidRuntime: at android.os.Looper.loop(Looper.java:144)
02-14 08:12:52.438 26718 26718 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5845)
02-14 08:12:52.438 26718 26718 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-14 08:12:52.438 26718 26718 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
02-14 08:12:52.438 26718 26718 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
02-14 08:12:52.446 1062 2435 W ActivityManager: Force finishing activity com.sampleapp/.MainActivity
02-14 08:12:52.498 1062 2435 D PMS : acquireWL(f07ef11): PARTIAL_WAKE_LOCK *launch* 0x1 1062 1000 WorkSource{10256}
02-14 08:12:52.563 1062 1081 D StatusBarManagerService: setSystemUiVisibility(0x8000)
02-14 08:12:52.563 1062 1081 D StatusBarManagerService: disable:userId=0 what=0x0 which=0x1 pkg=Window{f67b705 u0 Application Error: com.sampleapp}
02-14 08:12:52.563 1062 1081 D StatusBarManagerService: hiding MENU key
02-14 08:12:52.832 1062 1184 D PMS : releaseHCC(967c58c): CPU_MIN_NUM ActivityManager-MultiCore-Num 0x8000 null
02-14 08:12:52.832 1062 1184 D PMS : releaseHCC(5a7f4d5): CPU_MIN_FREQ ActivityManager-MultiCore-Freq 0x2000 null
02-14 08:12:52.999 1062 1080 W ActivityManager: Activity pause timeout for ActivityRecord{858d360 u0 com.sampleapp/.MainActivity t2027 f}
02-14 08:12:53.108 1062 1072 D PMS : releaseWL(f07ef11): PARTIAL_WAKE_LOCK *launch* 0x1 WorkSource{2897}

Related

React Native App crashing on release mode but working fine debug mode

My React native app was working fine few days back on both release and debug mode but from yesterday it keeps crashing on start in release mode, but it is working perfectly fine on debug mode.
When i ran
adb logcat *:E
it gave me following logs but i can't find anything on internet related to this
02-17 18:30:56.108 564 595 E libPowerHal: Could not open '/proc/1705/comm'
02-17 18:30:56.108 564 595 E libPowerHal: error : 13, Permission denied
02-17 18:30:56.260 22398 22398 E com.blackhedge: Not starting debugger since process cannot load the jdwp agent.
02-17 18:30:56.282 564 595 E libPowerHal: perfLockRel handle:293
02-17 18:30:56.517 22398 22398 E libc : Access denied finding property "ro.vendor.df.effect.conflict"
02-17 18:30:56.518 534 22445 E ResolverController: No valid NAT64 prefix (105, <unspecified>/0)
02-17 18:30:56.518 534 22447 E ResolverController: No valid NAT64 prefix (105, <unspecified>/0)
02-17 18:30:56.518 534 22446 E ResolverController: No valid NAT64 prefix (105, <unspecified>/0)
02-17 18:30:56.597 564 595 E libPowerHal: perfLockRel handle:294
02-17 18:30:56.716 1204 1687 E WindowManager: App trying to use insecure INPUT_FEATURE_NO_INPUT_CHANNEL flag. Ignoring
02-17 18:30:56.716 534 22467 E ResolverController: No valid NAT64 prefix (105, <unspecified>/0)
02-17 18:30:56.720 22398 22454 E AndroidRuntime: FATAL EXCEPTION: create_react_context
02-17 18:30:56.720 22398 22454 E AndroidRuntime: Process: com.blackhedge, PID: 22398
02-17 18:30:56.720 22398 22454 E AndroidRuntime: java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
02-17 18:30:56.720 22398 22454 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
02-17 18:30:56.720 22398 22454 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:239)
02-17 18:30:56.720 22398 22454 E AndroidRuntime: at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:29)
02-17 18:30:56.720 22398 22454 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:268)
02-17 18:30:56.720 22398 22454 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1371)
02-17 18:30:56.720 22398 22454 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136)
02-17 18:30:56.720 22398 22454 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1065)
02-17 18:30:56.720 22398 22454 E AndroidRuntime: at java.lang.Thread.run(Thread.java:919)
02-17 18:30:56.730 22398 22457 E fullstory: Destroy scanner called twice
02-17 18:30:56.809 1204 1329 E InputDispatcher: channel '81fad7a com.blackhedge/com.blackhedge.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
02-17 18:30:56.812 4731 4790 E PowerKeeper.Event: oops, parse AM_RESTART_ACTIVITY_AI parameter error
02-17 18:30:56.814 1204 1343 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
02-17 18:30:57.182 1705 1705 E Launcher: changeViewByFsGestureState, view=ShortcutMenuLayer, alpha=1.0, scale=1.0
02-17 18:30:57.233 564 595 E libPowerHal: perfLockRel handle:295
02-17 18:30:59.825 1204 1343 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
I tried generating logs and searched on internet the errors i was getting on logs but found nothing
this error is caused by the absence of the index.android.bundle file in the ./android/app/src/main/assets directory
First step:
Create the assets folder if it does not exist in the android/app/src/main/ directory
Second step:
Run the following command line:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res/
Step three:
Compile the application in release mode

How to fix React native app stopped working on android

i added firebase to my react native project and it's stopped running on my emulator. I've had this issue with firebase & react-native some years back, don't know what the fix was.
Running adb logcat displays this
04-24 22:13:32.453 371 394 E system_server: Invalid ID 0x00000000.
04-24 22:13:32.465 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.468 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.471 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.476 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.479 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.480 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.482 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.484 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.485 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.486 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.487 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.488 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.493 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.494 4759 4759 E com.mvmarket: Unknown bits set in runtime_flags: 0x8000
04-24 22:13:32.494 371 398 E memtrack: Couldn't load memtrack module
04-24 22:13:32.748 174 4798 E ResolverController: No valid NAT64 prefix (101, <unspecified>/0)
04-24 22:13:32.755 202 271 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
04-24 22:13:32.755 202 271 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
04-24 22:13:32.818 4759 4807 E AndroidRuntime: FATAL EXCEPTION: create_react_context
04-24 22:13:32.818 4759 4807 E AndroidRuntime: Process: com.mvmarket, PID: 4759
04-24 22:13:32.818 4759 4807 E AndroidRuntime: java.lang.NoSuchMethodError: No static method createEgl14([I)Lorg/webrtc/EglBase14; in class Lorg/webrtc/EglBase; or its super classes (declaration of 'org.webrtc.EglBase' appears in /data/app/com.mvmarket-R-KOl49no3K6lCqfeV5j9A==/base.apk)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.oney.WebRTCModule.EglUtils.getRootEglBase(EglUtils.java:35)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.oney.WebRTCModule.EglUtils.getRootEglBaseContext(EglUtils.java:62)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.oney.WebRTCModule.WebRTCModule.<init>(WebRTCModule.java:107)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.oney.WebRTCModule.WebRTCModule.<init>(WebRTCModule.java:76)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.oney.WebRTCModule.WebRTCModulePackage.createNativeModules(WebRTCModulePackage.java:15)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.facebook.react.ReactPackageHelper.getNativeModuleIterator(ReactPackageHelper.java:42)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:42)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1476)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1447)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1341)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1200(ReactInstanceManager.java:138)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1111)
04-24 22:13:32.818 4759 4807 E AndroidRuntime: at java.lang.Thread.run(Thread.java:919)
04-24 22:13:32.850 371 473 E InputDispatcher: channel '932d8ad com.mvmarket/com.mvmarket.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
04-24 22:13:32.857 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.857 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.874 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.890 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.906 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.924 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.940 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.956 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.974 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
04-24 22:13:32.990 202 202 E Layer : [Surface(name=AppWindowToken{82ce2ce token=Token{53e3bc9 ActivityRecord{127bfd0 u0 com.mvmarket/.MainActivity t75}}})/#0xafd9b7e - animation-leash#0] No local sync point found
Fixed it
According to the stacktrace, it was an issue with react-native-webrtc
Fixed with this https://stackoverflow.com/a/67592188/11901942
Thanks #Gabe Sechan

Page does not render completely and keeps on flickering through appium but renders correctly when done manually

I have a test case scenario to add medicine to a cart as below:
send medicine name in textbox
from the search results select the medicine by clicking ADD button
verify add medicine
Issue: When I click on the add button in step 2, the medicine gets added, but the page starts to flicker i.e. page keeps on rendering or refreshing (I don't know what to call in exactly), and so I am not able to perform the next steps.
One more concern is that the same scenario works perfectly when executed manually. The issue occurs only for execution done via appium. If I stop the appium server at the point where issue occurs, the flickering stops.
So seems to me like appium is messing something up.
My Android app is React Native app.
At the point of failure I can see below failure in adb logs:
Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
ADB logs:
09-19 15:20:05.274 2132 2132 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-19 15:20:05.690 2132 2132 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-19 15:20:10.719 2132 2132 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-19 15:20:10.770 15240 15240 I chatty : uid=10105(com.medlife.customer) expire 5 lines
09-19 15:20:10.784 2132 2132 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-19 15:20:10.809 2132 2132 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-19 15:20:10.916 2132 2132 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
ADB logs while executing on real device:
09-26 16:11:30.314 775 775 D SurfaceFlinger: duplicate layer name: changing com.medlife.customer/com.medlife.customer.MainActivity to com.medlife.customer/com.medlife.customer.MainActivity#1
09-26 16:11:30.524 30011 30084 I chatty : uid=10273(com.medlife.customer) expire 45 lines
09-26 16:11:30.611 775 1301 W SurfaceFlinger: Attempting to set client state on removed layer: Splash Screen com.medlife.customer#0
09-26 16:11:30.611 775 1301 W SurfaceFlinger: Attempting to destroy on removed layer: Splash Screen com.medlife.customer#0
09-26 16:11:32.669 30011 30132 I chatty : uid=10273(com.medlife.customer) expire 5 lines
09-26 16:11:32.695 30011 30134 I chatty : uid=10273(com.medlife.customer) expire 4 lines
09-26 16:11:32.980 775 1301 W SurfaceFlinger: Attempting to set client state on removed layer: com.medlife.customer/com.medlife.customer.MainActivity#1
09-26 16:11:32.980 775 1301 W SurfaceFlinger: Attempting to destroy on removed layer: com.medlife.customer/com.medlife.customer.MainActivity#1
09-26 16:11:33.313 30011 30022 I chatty : uid=10273(com.medlife.customer) expire 3 lines
09-26 16:11:33.317 30011 30020 I chatty : uid=10273(com.medlife.customer) expire 36 lines
09-26 16:11:43.478 30011 30011 I chatty : uid=10273(com.medlife.customer) expire 12 lines
09-26 16:11:46.282 1451 1644 D ActivityManager: handleProcessStartedLocked mDoneFinishBooting && app.pid != 0 ---> notifyProcessStart, app.processName = android:ui, app.info = ApplicationInfo{58c1294 android}, app.hostingType = activity, getHostingName() = ComponentInfo{android/com.android.internal.app.ChooserActivity}, getIntentFlag() = 0, getIsPackageRunning() = false, app = ProcessRecord{ae3a8d2 30232:android:ui/1000}, getExtraData() = Bundle[{ACTIVITY_TASK_AFFINITY=android, ACTIVITY_INTENT=Intent { act=android.intent.action.CHOOSER flg=0x800000 cmp=android/com.android.internal.app.ChooserActivity (has extras) }, CALLER_PACKAGE=com.medlife.customer, ACTIVITY_INFO=ActivityInfo{382be16 com.android.internal.app.ChooserActivity}}]
09-26 16:11:47.830 1451 1714 D AR_ADV_APPS_USAGE_COL: com.medlife.customer -> resizable apps -> USAGE 17406
09-26 16:11:51.603 30011 30084 I chatty : uid=10273(com.medlife.customer) expire 624 lines
09-26 16:11:54.508 30011 30011 I chatty : uid=10273(com.medlife.customer) expire 1 line
09-26 16:11:54.619 2492 2492 I AndroidIME: PasswordIme.onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Show : AutoCorrection = Disable : Microphone = Show : NoPersonalizedLearning = Disable
09-26 16:11:54.798 2492 2492 I ConversationToQueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-26 16:11:55.057 2492 2492 I AndroidIME: LatinIme.onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : NoPersonalizedLearning = Disable
09-26 16:11:55.191 2492 2492 I ConversationToQueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-26 16:11:59.524 30011 30020 I chatty : uid=10273(com.medlife.customer) expire 3 lines
09-26 16:12:09.589 30011 30084 I chatty : uid=10273(com.medlife.customer) expire 541 lines
09-26 16:12:23.113 30011 30084 I chatty : uid=10273(com.medlife.customer) expire 21 lines
09-26 16:12:30.807 1451 2766 I ActivityManager: Force stopping com.medlife.customer appid=10273 user=0: from pid 30567
09-26 16:12:30.812 1451 2766 I ActivityManager: Killing 30011:com.medlife.customer/u0a273 (adj 0): stop com.medlife.customer
09-26 16:12:30.818 1451 2766 W ActivityManager: Force removing ActivityRecord{4610f1b u0 com.medlife.customer/.MainActivity t24974}: app died, no saved state
09-26 16:12:30.926 1451 1714 D AR_ADV_APPS_USAGE_COL: com.medlife.customer -> resizable apps -> USAGE 38817
09-26 16:12:31.912 1451 4565 I ActivityManager: Force stopping com.medlife.customer appid=10273 user=0: from pid 30594
09-26 16:13:41.434 3974 31010 D PowerCalculator: topApCounter com.medlife.customer
09-26 16:13:41.434 3974 31010 D PowerCalculator: topApCounter com.medlife.customer
09-26 16:13:41.434 3974 31010 D PowerCalculator: topApCounter com.medlife.customer
ADB logs post after disabling:
09-30 12:43:17.696 1992 3969 I ActivityManager: Force stopping com.medlife.customer appid=10102 user=0: from pid 5797
09-30 12:43:17.697 1992 3969 I ActivityManager: Killing 5609:com.medlife.customer/u0a102 (adj 0): stop com.medlife.customer
09-30 12:43:17.709 1992 3969 W ActivityManager: Force removing ActivityRecord{8440c12 u0 com.medlife.customer/.MainActivity t113}: app died, no saved state
09-30 12:43:18.010 1992 3969 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.medlife.customer/.MainActivity} from uid 2000
09-30 12:43:18.174 1992 2012 I ActivityManager: Start proc 5800:com.medlife.customer/u0a102 for activity com.medlife.customer/.MainActivity
09-30 12:43:18.505 5800 5819 I FA : adb shell setprop debug.firebase.analytics.app com.medlife.customer
09-30 12:43:18.975 5800 5879 I edlife.custome: Thread[44,tid=5879,Native,Thread*=0x75721b54ec00,peer=0x12fd1880,"create_react_context"] recursive attempt to load library "/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/lib/x86_64/libfb.so"
09-30 12:43:19.225 5800 5891 D : Successfully queried cache dir: /data/user_de/0/com.medlife.customer/code_cache
09-30 12:43:19.226 5800 5891 D RenderScript: Setting cache dir: /data/user_de/0/com.medlife.customer/code_cache
09-30 12:43:19.433 1928 1928 D SurfaceFlinger: duplicate layer name: changing com.medlife.customer/com.medlife.customer.MainActivity to com.medlife.customer/com.medlife.customer.MainActivity#1
09-30 12:43:19.614 5800 5883 I edlife.custome: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceIdService" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/base.apk"],nativeLibraryDirectories=[/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/lib/x86_64, /data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/base.apk!/lib/x86_64, /system/lib64]]
09-30 12:43:19.616 5800 5883 I edlife.custome: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceIdService" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/base.apk"],nativeLibraryDirectories=[/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/lib/x86_64, /data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/base.apk!/lib/x86_64, /system/lib64]]
09-30 12:43:19.694 1992 2018 I ActivityManager: Displayed com.medlife.customer/.MainActivity: +1s549ms
09-30 12:43:21.337 1928 2346 W SurfaceFlinger: Attempting to set client state on removed layer: com.medlife.customer/com.medlife.customer.MainActivity#1
09-30 12:43:21.337 1928 2346 W SurfaceFlinger: Attempting to destroy on removed layer: com.medlife.customer/com.medlife.customer.MainActivity#1
09-30 12:43:23.086 5800 5952 E cr_VariationsUtils: Failed reading seed file "/data/user/0/com.medlife.customer/app_webview/variations_seed": /data/user/0/com.medlife.customer/app_webview/variations_seed (No such file or directory)
09-30 12:43:34.090 2128 2128 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-30 12:43:34.395 2128 2128 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-30 12:43:37.846 2128 2128 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-30 12:43:37.856 2128 2128 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-30 12:43:38.429 2128 2128 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-30 12:43:38.465 2128 2128 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-30 12:46:28.724 1992 2665 I ActivityManager: Force stopping com.medlife.customer appid=10102 user=0: from pid 6074
09-30 12:46:28.724 1992 2665 I ActivityManager: Killing 5800:com.medlife.customer/u0a102 (adj 0): stop com.medlife.customer
09-30 12:46:28.725 1992 2665 W ActivityManager: Force removing ActivityRecord{f56adcb u0 com.medlife.customer/.MainActivity t114}: app died, no saved state
09-30 12:46:29.671 1992 2666 I ActivityManager: Force stopping com.medlife.customer appid=10102 user=0: from pid 6091
You need to increase the RAM and internal storage size that you are assigning to the emulator in order for that exception to go away. You are trying to do some action in the android code that's eating up the emulator's RAM and internal memory.

Release application always crashing on splash screen

I'm facing an issue with React Native release builds. Either on iPhone or Android, my application works fine in debug mode, but after building with release configuration, the app always crashes on the splash screen.
On Android, I'm getting an OutOfMemory in the log triggered by WebSocketReader.java. Here is the Android log :
07-26 10:57:18.639 5893 7623 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
07-26 10:57:18.639 5893 7623 E AndroidRuntime: Process: com.schooltoring, PID: 5893
07-26 10:57:18.639 5893 7623 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 10628794 byte allocation with 4409280 free bytes and 4MB until OOM
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at java.lang.StringFactory.newStringFromBytes(StringFactory.java:79)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at java.lang.StringFactory.newStringFromBytes(StringFactory.java:207)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at okio.Buffer.readString(Buffer.java:620)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at okio.Buffer.readUtf8(Buffer.java:591)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:222)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:101)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:262)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:201)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
07-26 10:57:18.639 5893 7623 E AndroidRuntime: at java.lang.Thread.run(Thread.java:762)
Complete log : https://gist.github.com/SLedunois/7d801cb0e55f2ae98bdbc054b0a84e61 (Sorry about the link. Crash report are too long to be included in the body)
On iPhone, I don't really understand the crash report. I'm new at iOS development. Here is the iOS crash report :
https://gist.github.com/SLedunois/76eaa85dfebb2ceff1f97cb4723989f1
I think, the error is caused by :
Thread 12 Crashed:
0 libsystem_kernel.dylib 0x00000001815192ec __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001816ba288 pthread_kill$VARIANT$mp + 376
2 libsystem_c.dylib 0x0000000181487d0c abort + 140
3 Schooltoring 0x0000000100ccc734 0x100c78000 + 345908
4 CoreFoundation 0x0000000181a931c8 __handleUncaughtException + 828
5 libobjc.A.dylib 0x0000000180c4c8c8 _objc_terminate+ 35016 () + 112
6 Schooltoring 0x0000000100cb090c 0x100c78000 + 231692
7 libc++abi.dylib 0x0000000180c3d37c std::__terminate(void (*)+ 111484 ()) + 16
8 libc++abi.dylib 0x0000000180c3cccc __cxxabiv1::exception_cleanup_func+ 109772 (_Unwind_Reason_Code, _Unwind_Exception*) + 0
9 libobjc.A.dylib 0x0000000180c4c720 _objc_exception_destructor+ 34592 (void*) + 0
10 Schooltoring 0x0000000100d61af0 0x100c78000 + 957168
11 Schooltoring 0x0000000100d61638 0x100c78000 + 955960
12 libdispatch.dylib 0x0000000181384aa0 _dispatch_call_block_and_release + 24
13 libdispatch.dylib 0x0000000181384a60 _dispatch_client_callout + 16
14 libdispatch.dylib 0x000000018138e9b4 _dispatch_queue_serial_drain$VARIANT$mp + 608
15 libdispatch.dylib 0x000000018138f2fc _dispatch_queue_invoke$VARIANT$mp + 336
16 libdispatch.dylib 0x000000018138fcc8 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 340
17 libdispatch.dylib 0x0000000181398098 _dispatch_workloop_worker_thread$VARIANT$mp + 668
18 libsystem_pthread.dylib 0x00000001816b7e70 _pthread_wqthread + 860
19 libsystem_pthread.dylib 0x00000001816b7b08 start_wqthread + 4
All my builds are configured to be signed.
Does someone face a similar issue?
Try adding android:largeHeap="true" to your manifest under application:
Ex. <application android:label="YourApp" android:largeHeap="true"></application>
Found solution. The error was triggered because of the static image used in the application were too big.
See https://facebook.github.io/react-native/docs/images for more explanations.

android.content.ActivityNotFoundException: No Activity found to handle Intent

I m a newbie to Android. I am trying to use google location API and when run in the emulator it shows Unfortunately your app stopped working.
I did a adb logcat and here is my stacktrace
10-31 23:43:02.010 2370 2370 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
10-31 23:43:02.011 2370 2370 D AndroidRuntime: CheckJNI is ON
10-31 23:43:02.026 2370 2370 I art : JIT created with code_cache_capacity=2MB compile_threshold=1000
10-31 23:43:02.030 2370 2370 D ICU : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
10-31 23:43:02.044 2370 2370 E memtrack: Couldn't load memtrack module (No such file or directory)
10-31 23:43:02.044 2370 2370 E android.os.Debug: failed to load memtrack module: -2
10-31 23:43:02.045 2370 2370 I Radio-JNI: register_android_hardware_Radio DONE
10-31 23:43:02.062 2370 2370 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
10-31 23:43:02.073 2228 2240 I art : CollectorTransition marksweep + semispace GC freed 125(-7KB) AllocSpace objects, 0(0B) LOS objects, 57% free, 379KB/891KB, paused 5.591ms total 5.591ms
10-31 23:43:02.080 2228 2242 D DefContainer: Copying /data/local/tmp/HighwayMechanic.apk to base.apk
10-31 23:43:02.181 1138 1177 I PackageManager.DexOptimizer: Running dexopt (dex2oat) on: /data/app/vmdl931695514.tmp/base.apk pkg=com.highway.highwaymechanic isa=x86 vmSafeMode=false debuggable=true oatDir = /data/app/vmdl931695514.tmp/oat
10-31 23:43:02.190 2382 2382 W dex2oat : Unexpected CPU variant for X86 using defaults: x86
10-31 23:43:02.190 2382 2382 W dex2oat : Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2) for the command line:
10-31 23:43:02.190 2382 2382 W dex2oat : /system/bin/dex2oat --zip-fd=6 --zip-location=base.apk --oat-fd=7 --oat-location=/data/app/vmdl931695514.tmp/oat/x86/base.odex --instruction-set=x86 --instruction-set-variant=x86 --instruction-set-features=default --runtime-arg -Xms64m --runtime-arg -Xmx512m --swap-fd=8 --debuggable
10-31 23:43:02.190 2382 2382 I dex2oat : /system/bin/dex2oat --debuggable
10-31 23:43:08.200 2382 2382 I dex2oat : dex2oat took 6.009s (threads: 1) arena alloc=2MB java alloc=6MB native alloc=32MB free=2MB
10-31 23:43:08.276 1138 1162 I ActivityManager: Force stopping com.highway.highwaymechanic appid=10053 user=-1: uninstall pkg
10-31 23:43:08.294 1138 1177 I PackageManager: Package com.highway.highwaymechanic codePath changed from /data/app/com.highway.highwaymechanic-2 to /data/app/com.highway.highwaymechanic-1; Retaining data and using new
10-31 23:43:08.295 1138 1162 I ActivityManager: Force stopping com.highway.highwaymechanic appid=10053 user=-1: replace pkg
10-31 23:43:08.296 1138 1177 W PackageManager: Code path for com.highway.highwaymechanic changing from /data/app/com.highway.highwaymechanic-2 to /data/app/com.highway.highwaymechanic-1
10-31 23:43:08.296 1138 1177 W PackageManager: Resource path for com.highway.highwaymechanic changing from /data/app/com.highway.highwaymechanic-2 to /data/app/com.highway.highwaymechanic-1
10-31 23:43:08.333 1138 1177 W Settings: Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
10-31 23:43:08.333 1138 1177 I art : Starting a blocking GC Explicit
10-31 23:43:08.353 1138 1177 I art : Explicit concurrent mark sweep GC freed 10787(756KB) AllocSpace objects, 11(220KB) LOS objects, 19% free, 5MB/6MB, paused 517us total 13.651ms
10-31 23:43:08.357 1138 1177 W PackageManager: Couldn't remove dex file for package: at location /data/app/com.highway.highwaymechanic-2/base.apk, retcode=-1
10-31 23:43:08.359 1138 1177 I ActivityManager: Force stopping com.highway.highwaymechanic appid=10053 user=0: pkg removed
10-31 23:43:08.360 2370 2370 I art : System.exit called, status: 0
10-31 23:43:08.360 2370 2370 I AndroidRuntime: VM exiting with result code 0.
10-31 23:43:08.400 1138 1138 D JobSchedulerService: Receieved: android.intent.action.PACKAGE_REMOVED
10-31 23:43:08.403 1566 1566 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_REMOVED
10-31 23:43:08.404 1566 1566 D CarrierServiceBindHelper: mHandler: 3
10-31 23:43:08.404 1138 1255 I InputReader: Reconfiguring input devices. changes=0x00000010
10-31 23:43:08.414 1925 1925 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1221 android.content.ContextWrapper.startService:581 android.content.ContextWrapper.startService:581 com.android.keychain.KeyChainBroadcastReceiver.onReceive:12 android.app.ActivityThread.handleReceiver:2725
10-31 23:43:08.418 1138 1641 I BroadcastQueue: Delay finish: com.android.keychain/.KeyChainBroadcastReceiver
10-31 23:43:08.514 1138 1255 I InputReader: Reconfiguring input devices. changes=0x00000010
10-31 23:43:08.515 1138 2212 I BroadcastQueue: Resuming delayed broadcast
10-31 23:43:08.516 1566 1566 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_ADDED
10-31 23:43:08.516 1566 1566 D CarrierServiceBindHelper: mHandler: 3
10-31 23:43:08.602 1138 1255 I InputReader: Reconfiguring input devices. changes=0x00000010
10-31 23:43:08.602 1566 1566 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_REPLACED
10-31 23:43:08.602 1566 1566 D CarrierServiceBindHelper: mHandler: 3
10-31 23:43:08.602 1566 1566 D CarrierConfigLoader: mHandler: 9 phoneId: 0
10-31 23:43:08.617 2390 2390 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
10-31 23:43:08.619 2390 2390 D AndroidRuntime: CheckJNI is ON
10-31 23:43:08.635 2390 2390 I art : JIT created with code_cache_capacity=2MB compile_threshold=1000
10-31 23:43:08.640 2390 2390 D ICU : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
10-31 23:43:08.654 2390 2390 E memtrack: Couldn't load memtrack module (No such file or directory)
10-31 23:43:08.654 2390 2390 E android.os.Debug: failed to load memtrack module: -2
10-31 23:43:08.655 2390 2390 I Radio-JNI: register_android_hardware_Radio DONE
10-31 23:43:08.667 2390 2390 D AndroidRuntime: Calling main entry com.android.commands.am.Am
10-31 23:43:08.669 1138 2212 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.highway.highwaymechanic/.MainActivity} from uid 0 on display 0
10-31 23:43:08.691 2390 2390 D AndroidRuntime: Shutting down VM
10-31 23:43:08.695 2390 2395 I art : Debugger is no longer active
10-31 23:43:08.695 2390 2401 E art : Thread attaching while runtime is shutting down: Binder_2
10-31 23:43:08.695 2390 2401 I AndroidRuntime: NOTE: attach of thread 'Binder_2' failed
10-31 23:43:08.697 2402 2402 I art : Not late-enabling -Xcheck:jni (already on)
10-31 23:43:08.697 2402 2402 I art : Late-enabling JIT
10-31 23:43:08.702 2402 2402 I art : JIT created with code_cache_capacity=2MB compile_threshold=1000
10-31 23:43:08.708 1138 1712 I ActivityManager: Start proc 2402:com.highway.highwaymechanic/u0a53 for activity com.highway.highwaymechanic/.MainActivity
10-31 23:43:08.717 2402 2409 E art : Failed sending reply to debugger: Broken pipe
10-31 23:43:08.717 2402 2409 I art : Debugger is no longer active
10-31 23:43:08.728 2402 2402 W System : ClassLoader referenced unknown path: /data/app/com.highway.highwaymechanic-1/lib/x86
10-31 23:43:08.747 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.747 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.747 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.747 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.748 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.748 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.755 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.755 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.755 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.764 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.764 2402 2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.797 2402 2402 D gralloc_goldfish: Emulator without GPU emulation detected.
10-31 23:43:08.818 1138 1170 I ActivityManager: Displayed com.highway.highwaymechanic/.MainActivity: +129ms
10-31 23:43:10.932 1138 1429 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms&pcampaignid=gcore_8115000--- flg=0x80000 pkg=com.android.vending} from uid 10053 on display 0
10-31 23:43:10.933 2402 2402 D AndroidRuntime: Shutting down VM
10-31 23:43:10.933 2402 2402 E AndroidRuntime: FATAL EXCEPTION: main
10-31 23:43:10.933 2402 2402 E AndroidRuntime: Process: com.highway.highwaymechanic, PID: 2402
10-31 23:43:10.933 2402 2402 E AndroidRuntime: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms&pcampaignid=gcore_8115000--- flg=0x80000 pkg=com.android.vending }
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:3917)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:3877)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:748)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4200)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4168)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at com.google.android.gms.dynamic.zza$5.onClick(Unknown Source)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.view.View.performClick(View.java:5198)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.view.View$PerformClick.run(View.java:21147)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-31 23:43:10.933 2402 2402 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-31 23:43:10.934 1138 1712 W ActivityManager: Force finishing activity com.highway.highwaymechanic/.MainActivity
10-31 23:43:10.935 943 943 D gralloc : Registering a buffer in the process that created it. This may cause memory ordering problems.
10-31 23:43:10.935 943 943 E libEGL : called unimplemented OpenGL ES API
10-31 23:43:10.935 943 943 E SurfaceFlinger: glCheckFramebufferStatusOES error 1711643839
10-31 23:43:10.935 943 943 E SurfaceFlinger: got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
10-31 23:43:11.448 1138 1162 W ActivityManager: Activity pause timeout for ActivityRecord{40e8f1c u0 com.highway.highwaymechanic/.MainActivity t11 f}
10-31 23:43:21.478 1138 1162 W ActivityManager: Activity destroy timeout for ActivityRecord{40e8f1c u0 com.highway.highwaymechanic/.MainActivity t11 f}
Here is my Android_manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.highway.highwaymechanic"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.highway.highwaymechanic.Map"
android:label="#string/title_activity_map" >
</activity>
</application>
</manifest>
Here is my MainActivity.java file
package com.highway.highwaymechanic;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Here is my MapsActivity.java file
package com.highway.highwaymechanic;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
#Override
public void onMapReady(GoogleMap map) {
LatLng sydney = new LatLng(-34, 151);
map.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
map.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
}
When run in the emulator it crashes with Unfortunately the app stopped working.
Please help me with it.
Thanks in Advance
I believe this should have been fixed with the latest release of the Google Play services client library. Note that this is a fix in the client library and so you will have to update the library to the latest revision using your SDK manager and recompile your application.
for more details you can check this link
https://code.google.com/p/gmaps-api-issues/issues/detail?id=4862
Do you have an another Activity named Map? As I see in your manifest,
<activity
android:name="com.highway.highwaymechanic.Map"
android:label="#string/title_activity_map" >
</activity>
Likewise, there should be a similar tag for the MapsActivity in your manifest. I think this is the error.
it bugs out much sooner, missing some native assembly for x86 architecture:
W System: ClassLoader referenced unknown path: /data/app/com.highway.highwaymechanic-1/lib/x86
followed by:
W GooglePlayServicesUtil: Google Play services is missing.
To add the missing Google Play (incl. Maps) Services, wrote a how-to once (it's almost the same).
While that FragmentActivity requires an IntentFilter, else it cannot be launched, for example:
<activity
android:name=".MapsActivity"
android:label="#string/title_activity_map">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>

Categories

Resources