You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating (or rather trying to create) an application that is supposed to connect to an automatic greenhouse via bluetooth.
This application works with a database that I created with Firebase.
I also use a repository.
Problem, when I add the lines:
val repo = ProgramRepository()
repo.updateData()
The application opens and closes immediately!
Here is what is marked in the "Run" tab of android studio:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: fr.max.serreconnecte, PID: 3335
java.lang.ExceptionInInitializerError
at fr.max.serreconnecte.ProgramRepository.updateData(ProgramRepository.kt:23)
at fr.max.serreconnecte.MainActivity.onCreate(MainActivity.kt:16)
at android.app.Activity.performCreate(Activity.java:8093)
at android.app.Activity.performCreate(Activity.java:8067)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3452)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3651)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2104)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Caused by: com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your getInstance() call.
at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database@@19.2.1:97)
at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database@@19.2.1:57)
at fr.max.serreconnecte.ProgramRepository$Singleton.(ProgramRepository.kt:15)
at fr.max.serreconnecte.ProgramRepository.updateData(ProgramRepository.kt:23)
at fr.max.serreconnecte.MainActivity.onCreate(MainActivity.kt:16)
at android.app.Activity.performCreate(Activity.java:8093)
at android.app.Activity.performCreate(Activity.java:8067)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3452)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3651)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2104)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
I didn't find any answer on the forums
Help would be greatly appreciated.
Thanks in advance
The text was updated successfully, but these errors were encountered:
Hello,
I'm creating (or rather trying to create) an application that is supposed to connect to an automatic greenhouse via bluetooth.
This application works with a database that I created with Firebase.
I also use a repository.
Problem, when I add the lines:
val repo = ProgramRepository()
repo.updateData()
The application opens and closes immediately!
Here is what is marked in the "Run" tab of android studio:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: fr.max.serreconnecte, PID: 3335
java.lang.ExceptionInInitializerError
at fr.max.serreconnecte.ProgramRepository.updateData(ProgramRepository.kt:23)
at fr.max.serreconnecte.MainActivity.onCreate(MainActivity.kt:16)
at android.app.Activity.performCreate(Activity.java:8093)
at android.app.Activity.performCreate(Activity.java:8067)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3452)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3651)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2104)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Caused by: com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your getInstance() call.
at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database@@19.2.1:97)
at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database@@19.2.1:57)
at fr.max.serreconnecte.ProgramRepository$Singleton.(ProgramRepository.kt:15)
at fr.max.serreconnecte.ProgramRepository.updateData(ProgramRepository.kt:23)
at fr.max.serreconnecte.MainActivity.onCreate(MainActivity.kt:16)
at android.app.Activity.performCreate(Activity.java:8093)
at android.app.Activity.performCreate(Activity.java:8067)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3452)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3651)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2104)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
I didn't find any answer on the forums
Help would be greatly appreciated.
Thanks in advance
The text was updated successfully, but these errors were encountered: