I'm trying to follow a simple Flutter and Firebase tutorial that I found on YouTube. At the moment the app is just a simple login screen with a button that tries to sign the user in using the signInAnonymously function that Firebase provides.
However, every time I click the button to sign in the app crashes but, the new user is created and can be seen under authentication->users in the Firebase Console.
Here is the output from the debug console:
W/BiChannelGoogleApi( 2621): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak#e0bea08
W/DynamiteModule( 2621): Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth( 2621): [FirebaseAuth:] Loading module via FirebaseOptions.
I/FirebaseAuth( 2621): [FirebaseAuth:] Preparing to create service connection to gms implementation
E/JavaBinder( 2621): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
E/JavaBinder( 2621): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/JavaBinder( 2621): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/JavaBinder( 2621): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/JavaBinder( 2621): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzcl.zzdx(Unknown Source:13)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder( 2621): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/JavaBinder( 2621): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/JavaBinder( 2621): at android.os.Binder.execTransact(Binder.java:731)
E/JavaBinder( 2621): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/lib/x86, /data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/base.apk!/lib/x86, /system/lib]]
E/JavaBinder( 2621): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/JavaBinder( 2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/JavaBinder( 2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/JavaBinder( 2621): ... 16 more
E/AndroidRuntime( 2621): FATAL EXCEPTION: Binder:2621_1
E/AndroidRuntime( 2621): Process: com.teegeedigital.teegee_digital_app, PID: 2621
E/AndroidRuntime( 2621): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/AndroidRuntime( 2621): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/AndroidRuntime( 2621): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/AndroidRuntime( 2621): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzcl.zzdx(Unknown Source:13)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/AndroidRuntime( 2621): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/AndroidRuntime( 2621): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/AndroidRuntime( 2621): at android.os.Binder.execTransact(Binder.java:731)
E/AndroidRuntime( 2621): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/lib/x86, /data/app/com.teegeedigital.teegee_digital_app-uIKbQPsmHSCIvS-nf2ZtLQ==/base.apk!/lib/x86, /system/lib]]
E/AndroidRuntime( 2621): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/AndroidRuntime( 2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 2621): ... 16 more
I/Process ( 2621): Sending signal. PID: 2621 SIG: 9
Lost connection to device.
Exited (sigterm)
I'll also include my project build.gradle below:
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and my android/app build.gradle file:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.teegeedigital.teegee_digital_app"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-firestore:19.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
I'm relatively new to Mobile App Development so please let me know if I should include anything else. Any help would be appreciated.
You need to migrate to androidx, you can do that by adding:
android.useAndroidX=true
android.enableJetifier=true
In the android/gradle.properties.
You can find more about migration to androidx in this flutter guide:
https://flutter.dev/docs/development/androidx-migration
I'm using the regular use case for Firebase (It's a Flutter app) authentication. When I log in unsuccessfully, it gives me an error as expected. Whenever I successfully log in with it, it crashes my app with this message:
E/JavaBinder( 4289): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
E/JavaBinder( 4289): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/JavaBinder( 4289): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/JavaBinder( 4289): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/JavaBinder( 4289): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzcr.zzdx(Unknown Source:15)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/JavaBinder( 4289): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/JavaBinder( 4289): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/JavaBinder( 4289): at android.os.Binder.execTransact(Binder.java:731)
E/JavaBinder( 4289): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/lib/x86, /data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/base.apk!/lib/x86, /system/lib]]
E/JavaBinder( 4289): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/JavaBinder( 4289): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/JavaBinder( 4289): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/JavaBinder( 4289): ... 16 more
E/AndroidRuntime( 4289): FATAL EXCEPTION: Binder:4289_4
E/AndroidRuntime( 4289): Process: com.example.smartmoney, PID: 4289
E/AndroidRuntime( 4289): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzam.zzc(Unknown Source:22)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzam.zzde(Unknown Source:17)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzam.zzdd(Unknown Source:8)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzan.zzdf(Unknown Source:1)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzm.isAnonymous(Unknown Source:47)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzat.zzi(Unknown Source:57)
E/AndroidRuntime( 4289): at com.google.firebase.auth.internal.zzat.zzg(Unknown Source:10)
E/AndroidRuntime( 4289): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:62)
E/AndroidRuntime( 4289): at com.google.firebase.auth.FirebaseAuth$zzb.zza(Unknown Source:5)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzcr.zzdx(Unknown Source:15)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzen.zzen(Unknown Source:35)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzen.zza(Unknown Source:41)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzep.zza(Unknown Source:9)
E/AndroidRuntime( 4289): at com.google.firebase.auth.api.internal.zzdx.dispatchTransaction(Unknown Source:9)
E/AndroidRuntime( 4289): at com.google.android.gms.internal.firebase_auth.zza.onTransact(Unknown Source:13)
E/AndroidRuntime( 4289): at android.os.Binder.execTransact(Binder.java:731)
E/AndroidRuntime( 4289): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/lib/x86, /data/app/com.example.smartmoney-X1P2O9i7a7t81s9vttyrlA==/base.apk!/lib/x86, /system/lib]]
E/AndroidRuntime( 4289): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/AndroidRuntime( 4289): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 4289): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 4289): ... 16 more
I/Process ( 4289): Sending signal. PID: 4289 SIG: 9
Lost connection to device.
Sorry about the error dump. I've been working on this error for many hours. Here is project level gradle:
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.31.0' // Crashlytics plugin
classpath 'com.google.firebase:perf-plugin:1.3.1' // Performance Monitoring plugin
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here's my app level gradle:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.smartmoney"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:17.0.1' // Firebase core
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' // Firebase crashlytics
implementation 'com.google.firebase:firebase-perf:18.0.1' // Firebase performance
//implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
}
Here is my pubspec file:
name: smartmoney
description: A new Flutter project.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc: ^0.14.0
toast: ^0.1.5
charts_flutter: ^0.6.0
firebase_auth: ^0.14.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
Any help is appreciated. I have no lead on this besides I guess there might be some sort of messes up Java library. Which makes little sense because I rebuilt my project and it still failed. So I'm more or less scratching my head on this.
Please add the following lines in your gradle.properties file. It worked for me.
android.useAndroidX = true
android.enableJetifier = true
Thanks
I am trying to update some components situated in other Controller using FXMLLoader, When i run my code i get this exception :
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Node.fireEvent(Node.java:8413)
at javafx.scene.control.Button.fire(Button.java:185)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$353(GlassViewEventHandler.java:432)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431)
at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
at com.sun.glass.ui.View.notifyMouse(View.java:937)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1769)
... 52 more
Caused by: java.lang.RuntimeException: Text.text : A bound value cannot be set.
at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:140)
at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:49)
at javafx.scene.text.Text.setText(Text.java:370)
at javafxcyberwind.LoginController.conValide(LoginController.java:205)
... 62 more
This is my code :
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("Choix_Client.fxml"));
loader.load();
Choix_ClientController ctr = loader.getController();
ctr.tx_bn.setText(email_con.getText());//exception here
Parent parent = FXMLLoader.load(getClass().getResource("Choix_Client.fxml"));
Scene scene = new Scene(parent);
Stage stage = (Stage) ((Node) e.getSource()).getScene().getWindow();
stage.hide();
stage.setScene(scene);
stage.show();
How to solve this ?
11-29 09:16:02.227: E/AndroidRuntime(22528): FATAL EXCEPTION: JavaFX Application Thread
11-29 09:16:02.227: E/AndroidRuntime(22528): Process: com.nopanicaudiocollection, PID: 22528
11-29 09:16:02.227: E/AndroidRuntime(22528): java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
11-29 09:16:02.227: E/AndroidRuntime(22528): at java.util.ArrayList.get(ArrayList.java:411)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.gluonhq.impl.charm.down.plugins.DefaultVideoService.lambda$new$2(DefaultVideoService.java:105)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.gluonhq.impl.charm.down.plugins.DefaultVideoService$$Lambda$3.onChanged(Unknown Source)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:328)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:72)
11-29 09:16:02.227: E/AndroidRuntime(22528): at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:232)
11-29 09:16:02.227: E/AndroidRuntime(22528): at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
11-29 09:16:02.227: E/AndroidRuntime(22528): at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
11-29 09:16:02.227: E/AndroidRuntime(22528): at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:204)
11-29 09:16:02.227: E/AndroidRuntime(22528): at javafx.collections.ModifiableObservableListBase.addAll(ModifiableObservableListBase.java:102)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.nopanicaudiocollection.BasicView.lambda$null$3(BasicView.java:58)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.nopanicaudiocollection.BasicView$$Lambda$4.accept(Unknown Source)
11-29 09:16:02.227: E/AndroidRuntime(22528): at java.util.Optional.ifPresent(Optional.java:154)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.nopanicaudiocollection.BasicView.lambda$new$4(BasicView.java:54)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.nopanicaudiocollection.BasicView$$Lambda$1.handle(Unknown Source)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
11-29 09:16:02.227: E/AndroidRuntime(22528): at javafx.event.Event.fireEvent(Event.java:198)
11-29 09:16:02.227: E/AndroidRuntime(22528): at javafx.scene.Node.fireEvent(Node.java:8411)
11-29 09:16:02.227: E/AndroidRuntime(22528): at javafx.scene.control.Button.fire(Button.java:185)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
11-29 09:16:02.227: E/AndroidRuntime(22528): at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
11-29 09:16:02.228: E/AndroidRuntime(22528): at javafx.event.Event.fireEvent(Event.java:198)
11-29 09:16:02.228: E/AndroidRuntime(22528): at javafx.scene.Scene$MouseHandler.process(Scene.java:3761)
11-29 09:16:02.228: E/AndroidRuntime(22528): at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3489)
11-29 09:16:02.228: E/AndroidRuntime(22528): at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
11-29 09:16:02.228: E/AndroidRuntime(22528): at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2498)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
11-29 09:16:02.228: E/AndroidRuntime(22528): at java.security.AccessController.doPrivileged(AccessController.java:57)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$335(GlassViewEventHandler.java:388)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.tk.quantum.GlassViewEventHandler.access$lambda$1(GlassViewEventHandler.java)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$4.get(Unknown Source)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:391)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.View.notifyMouse(View.java:937)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.monocle.MonocleView.notifyMouse(MonocleView.java:119)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.monocle.MouseInput.notifyMouse(MouseInput.java:314)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.monocle.MouseInput.lambda$postMouseEvent$101(MouseInput.java:227)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.monocle.MouseInput.access$lambda$3(MouseInput.java)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.monocle.MouseInput$$Lambda$4.run(Unknown Source)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:93)
11-29 09:16:02.228: E/AndroidRuntime(22528): at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:52)
11-29 09:16:02.228: E/AndroidRuntime(22528): at java.lang.Thread.run(Thread.java:762)
public class BasicView extends View {
Label label = new Label();
public BasicView(String name) {
super(name);
ArrayList<String> playList = new ArrayList();
try {String line;//declare a string to hold each line of the document
InputStream is = getClass().getResourceAsStream("/music.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(is));//create a new buffered file reader to read a file reader
//use a while loop to read each line and add it to the list
while ((line = br.readLine()) != null) {
playList.add(line);
}
//close the buffered reader
br.close();
}
//catch block to catach and console print any exceptions
catch (IOException e)
{
System.out.println(e.getMessage());
}
ChoiceBox<String> choiceBox = new ChoiceBox();
choiceBox.getItems().addAll(playList);
choiceBox.getSelectionModel().selectFirst();
Button button = new Button("Set Track");
button.setOnAction(b -> {
System.setProperty("com.gluonhq.charm.down.debug", "true");
Services.get(VideoService.class).ifPresent(video -> {
video.getPlaylist().clear();
video.setPosition(Pos.CENTER, 0, 40, 0, 40);
video.setControlsVisible(false);
video.getPlaylist().add/*All(Arrays.asList*/(getChoice(choiceBox)/*)*/);
video.play();
Button playButton = MaterialDesignIcon.PLAY_ARROW.button();
playButton.setOnAction(e -> {
if (video.statusProperty().get() == Status.PLAYING) {
playButton.setGraphic(MaterialDesignIcon.PLAY_ARROW.graphic());
video.pause();
} else {
playButton.setGraphic(MaterialDesignIcon.PAUSE.graphic());
video.play();
}
});
Button stopButton = MaterialDesignIcon.STOP.button(e -> {
video.stop();
video.hide();}
);
getApplication().getAppBar().getActionItems().addAll(playButton, stopButton);
video.statusProperty().addListener((obs, ov, nv) -> {
if (video.statusProperty().get() == Status.PLAYING) {
playButton.setGraphic(MaterialDesignIcon.PAUSE.graphic());
} else {
playButton.setGraphic(MaterialDesignIcon.PLAY_ARROW.graphic());
}});
});
});
/*Button button = new Button("Change the World!");
button.setGraphic(new Icon(MaterialDesignIcon.LANGUAGE));
button.setOnAction(e -> label.setText("Hello JavaFX Universe!"));*/
VBox controls = new VBox(15.0, choiceBox, label, button);
controls.setAlignment(Pos.CENTER);
setCenter(controls);
}
private String getChoice(ChoiceBox<String> choiceBox) {
String music = choiceBox.getValue();
String nowPlaying = "Now Playing: ";
label.setText(nowPlaying + music);
return music;
}
#Override
protected void updateAppBar(AppBar appBar) {
appBar.setNavIcon(MaterialDesignIcon.MENU.button(e -> System.out.println("Menu")));
appBar.setTitleText("Audio Collection");
appBar.getActionItems().add(MaterialDesignIcon.SEARCH.button(e -> System.out.println("Search")));
}
}
I have a choice box that is filled by an array from a bufferedreader. That selects the music track. Then the theory is the getter method gets the selection of the choice box, sets the label and converts the selection into a string and returns it. Then the set track button activates the music by setting it up and setting the playlist after clearing the playlist. Now this all works the first time you can select any track and play it. When you stop the music and try to reselect the track you can use the choice box but as soon as you press the set track button again you get the above error. This is a gluon mobile single view project.
I create new Asp.net Core Web Application project with Angular template in Visual Studio 2017 (Version 15.3.2).
Then I install ngx-facebook
{
"name": "AspNetCoreMvcAngular_Web",
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"
},
"dependencies": {
"#angular/animations": "4.2.5",
"#angular/common": "4.2.5",
"#angular/compiler": "4.2.5",
"#angular/compiler-cli": "4.2.5",
"#angular/core": "4.2.5",
"#angular/forms": "4.2.5",
"#angular/http": "4.2.5",
"#angular/platform-browser": "4.2.5",
"#angular/platform-browser-dynamic": "4.2.5",
"#angular/platform-server": "4.2.5",
"#angular/router": "4.2.5",
"#ngtools/webpack": "1.5.0",
"#types/webpack-env": "1.13.0",
"angular2-template-loader": "0.6.2",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.1",
"awesome-typescript-loader": "3.2.1",
"bootstrap": "3.3.7",
"css": "2.2.1",
"css-loader": "0.28.4",
"es6-shim": "0.35.3",
"event-source-polyfill": "0.0.9",
"expose-loader": "0.7.3",
"extract-text-webpack-plugin": "2.1.2",
"file-loader": "0.11.2",
"html-loader": "0.4.5",
"isomorphic-fetch": "2.2.1",
"jquery": "3.2.1",
"json-loader": "0.5.4",
"ngx-facebook": "^2.4.0",
"preboot": "4.5.2",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.10",
"rxjs": "5.4.2",
"style-loader": "0.18.2",
"to-string-loader": "1.1.5",
"typescript": "2.4.1",
"url-loader": "0.5.9",
"webpack": "2.5.1",
"webpack-hot-middleware": "2.18.2",
"webpack-merge": "4.1.0",
"zone.js": "0.8.12"
},
"devDependencies": {
"#types/chai": "4.0.1",
"#types/jasmine": "2.5.53",
"chai": "4.0.2",
"jasmine-core": "2.6.4",
"karma": "1.7.0",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-webpack": "2.0.3"
}
}
Import FacebookModule into app's root module
import { NgModule } from '#angular/core';
import { CommonModule } from '#angular/common';
import { FormsModule } from '#angular/forms';
import { HttpModule } from '#angular/http';
import { RouterModule } from '#angular/router';
import { AppComponent } from './components/app/app.component';
import { NavMenuComponent } from './components/navmenu/navmenu.component';
import { HomeComponent } from './components/home/home.component';
import { FetchDataComponent } from './components/fetchdata/fetchdata.component';
import { CounterComponent } from './components/counter/counter.component';
import { FacebookModule } from 'ngx-facebook';
#NgModule({
declarations: [
AppComponent,
NavMenuComponent,
CounterComponent,
FetchDataComponent,
HomeComponent
],
imports: [
CommonModule,
HttpModule,
FormsModule,
FacebookModule.forRoot(),
RouterModule.forRoot([
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'counter', component: CounterComponent },
{ path: 'fetch-data', component: FetchDataComponent },
{ path: '**', redirectTo: 'home' }
])
]
})
export class AppModuleShared {
}
And try to inject FacebookService
import { Component } from '#angular/core';
import { FacebookService } from 'ngx-facebook';
#Component({
selector: 'app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}
When I run the project, an error occurs: NodeInvocationException: Prerendering failed because of error: Error: Cannot find module "." http://take.ms/ImVYb
An unhandled exception occurred while processing the request.
NodeInvocationException: Prerendering failed because of error: Error: Cannot find module "."
at webpackMissingModule (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:18316:69)
at Object.defineProperty.value (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:18316:147)
at Object.webpackEmptyContext.keys (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:18325:3)
at __webpack_require__ (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:20:30)
at Object.<anonymous> (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:17769:72)
at __webpack_require__ (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:20:30)
at Object.hasOwn (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:15835:77)
at __webpack_require__ (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:20:30)
at Object.<anonymous> (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:17976:81)
at __webpack_require__ (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:20:30)
Current directory is: C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web
Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance+<InvokeExportAsync>d__7.MoveNext()
Stack Query Cookies Headers
NodeInvocationException: Prerendering failed because of error: Error: Cannot find module "." at webpackMissingModule (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:18316:69) at Object.defineProperty.value (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:18316:147) at Object.webpackEmptyContext.keys (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:18325:3) at __webpack_require__ (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:20:30) at Object.<anonymous> (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:17769:72) at __webpack_require__ (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:20:30) at Object.hasOwn (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:15835:77) at __webpack_require__ (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:20:30) at Object.<anonymous> (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:17976:81) at __webpack_require__ (C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web\ClientApp\dist\main-server.js:20:30) Current directory is: C:\Users\Temirov\Desktop\ASP.NET\AspNetCoreMvcAngular\AspNetCoreMvcAngular.Web
Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance+<InvokeExportAsync>d__7.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance+<InvokeExportAsync>d__13.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNetCore.NodeServices.NodeServicesImpl+<InvokeExportWithPossibleRetryAsync>d__10.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.NodeServices.NodeServicesImpl+<InvokeExportWithPossibleRetryAsync>d__10.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNetCore.SpaServices.Prerendering.PrerenderTagHelper+<ProcessAsync>d__29.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner+<RunAsync>d__0.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
AspNetCore._Views_Home_Index_cshtml+<ExecuteAsync>d__12.MoveNext() in Index.cshtml
+
ViewData["Title"] = "Home Page";
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderPageCoreAsync>d__16.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderPageAsync>d__15.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__14.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor+<ExecuteAsync>d__22.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor+<ExecuteAsync>d__21.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.ViewResult+<ExecuteResultAsync>d__26.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeResultAsync>d__19.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeNextResultFilterAsync>d__24.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeNextResourceFilter>d__22.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeFilterPipelineAsync>d__17.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeAsync>d__15.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Builder.RouterMiddleware+<Invoke>d__4.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware+<Invoke>d__6.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware+<Invoke>d__6.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware+<Invoke>d__7.MoveNext()
What am I doing wrong? Thanks.
I had the same problem when running in visual studio 2017. It was missing a folder in './components/home/home.component' => './components/fetchdata/home/home.component'.
Hope this helps.