question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ANDROID] Unfortunately "App" has stopped

See original GitHub issue

Hi,

i’m currently trying to implement react-native-blur on my android app but at start app crash.

I applied the steps of android installation in the README,

android/app/build.gradle

repositories {
    maven { url 'https://github.com/500px/500px-android-blur/raw/master/releases/' }
}

buildscript {
    repositories {
        maven { url 'https://github.com/500px/500px-android-blur/raw/master/releases/' }
    }
    dependencies {
        classpath 'com.fivehundredpx:blurringview:1.0.0'
    }
}

index.android.js


import {BlurView} from 'react-native-blur';

export default class TryBlur extends Component {
  constructor() {
    super()
    this.state = {
      viewRef: 0,
    }
  }

  imageLoaded() {
    this.setState({viewRef: findNodeHandle(this.refs.backgroundImage)})
  }

  render() {
    return (
      <Image
        source={require('./bgimage.jpeg')}
        style={styles.container}
        ref={'backgroundImage'}
        onLoadEnd={this.imageLoaded.bind(this)}>
        <BlurView
          blurRadius={15}
          downsampleFactor={5}
          overlayColor={'rgba(255, 255, 255, .25)'}
          style={styles.blurView}
          viewRef={this.state.viewRef}/>
        <Text style={styles.welcome}>{`Blur component`}</Text>
      </Image>
    );
  }
}

Could you help me to fix it ?

react-native version : 0.40 react-native-blur version : 2.0.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:31 (7 by maintainers)

github_iconTop GitHub Comments

9reactions
Kureevcommented, Feb 18, 2017

I’ll merge a PR as soon as it’ll be there 😃

4reactions
FullstackJackcommented, Feb 15, 2017

Was getting the same unexpected quit for components using react-native-blur. It seems a critical step was removed from the Android Getting Started section. RenderScript is still used by BlurringView and needs to be included in android/app/build.gradle.

Here is the error message in logcat:

02-15 11:58:10.368 19219 19219 E AndroidRuntime: FATAL EXCEPTION: main
02-15 11:58:10.368 19219 19219 E AndroidRuntime: Process: com.starterkit, PID: 19219
02-15 11:58:10.368 19219 19219 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v8/renderscript/RenderSc
ript;
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.fivehundredpx.android.blur.BlurringView.initializeRenderScript(BlurringView.java:
98)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.fivehundredpx.android.blur.BlurringView.<init>(BlurringView.java:37)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.fivehundredpx.android.blur.BlurringView.<init>(BlurringView.java:26)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.cmcewen.blurview.BlurViewManager.createViewInstance(BlurViewManager.java:24)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.cmcewen.blurview.BlurViewManager.createViewInstance(BlurViewManager.java:11)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:46)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarch
yManager.java:218)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewO
perationQueue.java:148)

02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPen
dingNonBatchedOperations(UIViewOperationQueue.java:890)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuar
ded(UIViewOperationQueue.java:863)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreog
rapherFrameCallback.java:32)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(
ReactChoreographer.java:131)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:918)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at android.view.Choreographer.doCallbacks(Choreographer.java:695)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at android.view.Choreographer.doFrame(Choreographer.java:628)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:158)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7224)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
02-15 11:58:10.368 19219 19219 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v8.renderscript
.RenderScript" on path: DexPathList[[zip file "/data/app/com.starterkit-1/base.apk"],nativeLibraryDirectories=[/data/app/com.starterkit-1/lib/ar
m, /data/app/com.starterkit-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        ... 23 more
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        Suppressed: java.lang.ClassNotFoundException: android.support.v8.renderscript.RenderScri
pt
02-15 11:58:10.368 19219 19219 E AndroidRuntime:                at java.lang.Class.classForName(Native Method)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:                at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:                at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:                at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
02-15 11:58:10.368 19219 19219 E AndroidRuntime:                ... 24 more
02-15 11:58:10.368 19219 19219 E AndroidRuntime:        Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader;

Mix the following into your build.gradle:

android
    ...
    defaultConfig {
        renderscriptTargetApi 19
        renderscriptSupportModeEnabled true
        ...

Albeit, the view does not blur, but that is my issue of not implementing a custom component.android.js. At least the view does not cause the app to crash.

Read more comments on GitHub >

github_iconTop Results From Across the Web

8 Quick Ways to Fix “Unfortunately App Has Stopped” On ...
Restart your phone · Check for low storage and RAM · Update the Android system WebView app · Ensure the affected app is...
Read more >
7 Ways to Fix 'Unfortunately, App Has Stopped' Error on ...
1. Restart Your Phone · 2. Force Stop the App · 3. Update the App · 4. Clear App Cache & Data ·...
Read more >
How to Eliminate the "Unfortunately, App Has Stopped" ...
The “Unfortunately, App has stopped” message can also be caused by a corrupted SD card. To check, remove the SD card and try...
Read more >
Fixed “Unfortunately App Has Stopped” Error On Android ...
How to Fix Unfortunately App Has Stopped Error on Android? List of Solutions: Restart Your Phone; Clear the Cache and Data; Reset the...
Read more >
How to fix 'Unfortunately app has stopped' error on Android
How to Fix Unfortunately App Has Stopped Error on Android? Restart Your Phone. Clear the Cache and Data. Reset the App. Check for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found