realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

database creation #7684

Closed rzong closed 1 year ago

rzong commented 2 years ago

How frequently does the bug occur?

Seen once

Description

I specified the path when I created the database , But the app crashed,When I wanted to reproduce the problem, I found that the database was created, but not the path I specified

Stacktrace & log output

1-27 15:40:09.336  1602  1602 E AndroidRuntime: FATAL EXCEPTION: main
01-27 15:40:09.336  1602  1602 E AndroidRuntime: Process: com.iie.securityconference, PID: 1602
01-27 15:40:09.336  1602  1602 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.iie.securityconference/com.iie.securityconference.ui.activity.LoginActivity}: io.realm.exceptions.RealmFileException: Directory at path '/data/userdata/SecurityConference/db/securityconference.lock' does not exist. (open("/data/userdata/SecurityConference/db/securityconference.lock") failed: No such file or directory Path: /data/userdata/SecurityConference/db/securityconference.lock

Can you reproduce the bug?

Not yet

Reproduction Steps

No response

Version

10.10.1

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Android 7.1.2

Build environment

Android Studio version: ... Android Build Tools version: ... Gradle version: ...

cmelchior commented 2 years ago

Hi @rzong

Can you post the code snippet for exactly what you are doing? That path you post there looks illegal as it is outside the Apps private folder?

rzong commented 2 years ago

realm.createOrUpdateAllFromJson(Expert.class, mJarray);

rzong commented 2 years ago

01-27 15:40:09.336 1602 1602 E AndroidRuntime: ) (/data/userdata/SecurityConference/db/securityconference.lock) in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 107 Kind: NOT_FOUND. 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2736) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at android.app.ActivityThread.-wrap12(ActivityThread.java) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1487) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6157) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913) 01-27 15:40:09.336 1602 1602 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:803)

sync-by-unito[bot] commented 1 year ago

➤ Clemente Tort Barbero commented:

Is this still an issue?

clementetb commented 1 year ago

Closing due to inactivity.