After updating my project to android 10 I got crash on database open.
Logcat report:
2020-11-16 09:27:52.091 20196-22102/? E/SQLiteDatabase: Failed to open database '/data/user/0/bezeq.gala.preprod/databases/bezeqlocator.db'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 1294 SQLITE_CANTOPEN_ENOENT[1294]): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:300)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:218)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:737)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:284)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:251)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:1386)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:1331)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:994)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:940)
at com.bezeq.locator.dao.db.DBHelper.checkDataBase(DBHelper.java:210)
at com.bezeq.locator.dao.db.DBHelper.create(DBHelper.java:154)
at com.bezeq.locator.service.services.OnStartService$CreateDbFromFile.doInBackground(OnStartService.java:113)
at com.bezeq.locator.service.services.OnStartService$CreateDbFromFile.doInBackground(OnStartService.java:101)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "bezeq.gala"
minSdkVersion 24
targetSdkVersion 29
versionCode 71
versionName "15.0.71"
multiDexEnabled true
project.ext.set("archivesBaseName", "bview-" + defaultConfig.versionName);
}
dexOptions {
javaMaxHeapSize "4096M"
}
signingConfigs {
release {
keyAlias 'gala'
storeFile file('\\\\amam\\root\\oss\\BVieW\\Keys\\gala_signature_key.jks')
keyPassword System.getenv("BviewKeystorePassword")
storePassword System.getenv("BviewKeystorePassword")
}
}
buildTypes {
def PERMISSIONS_SYSTEM_SYMBOL = "PERMISSIONS_SYSTEM_SYMBOL"
def REST_API_URL = "REST_API_URL"
localhost_emulator {
applicationIdSuffix ".dev"
debuggable true
signingConfig signingConfigs.release
buildConfigField 'String', PERMISSIONS_SYSTEM_SYMBOL, '"GALD"';
buildConfigField 'String', REST_API_URL, '"http://10.0.2.2:8080/gala"';
manifestPlaceholders = [appName: "BVieW Dev"]
}
localhost_device {
applicationIdSuffix ".dev"
debuggable true
signingConfig signingConfigs.release
buildConfigField 'String', PERMISSIONS_SYSTEM_SYMBOL, '"GALD"';
buildConfigField 'String', REST_API_URL, '"http://localhost:5000/gala"';
manifestPlaceholders = [appName: "BVieW Dev"]
}
debug {
applicationIdSuffix ".dev"
debuggable true
signingConfig signingConfigs.release
buildConfigField 'String', PERMISSIONS_SYSTEM_SYMBOL, '"GALD"';
buildConfigField 'String', REST_API_URL, '"http://vm-tbvwwebt1.bezeq.com:8180/gala"';
manifestPlaceholders = [appName: "BVieW Dev"]
}
tst { // Build types may not start with 'test'
applicationIdSuffix ".tst"
debuggable false
signingConfig signingConfigs.release
buildConfigField 'String', PERMISSIONS_SYSTEM_SYMBOL, '"GALT"';
buildConfigField 'String', REST_API_URL, '"http://vm-tbvwwebt1.bezeq.com:8180/gala"';
manifestPlaceholders = [appName: "BVieW Test"]
}
release {
debuggable false
// minifyEnabled true
signingConfig signingConfigs.release
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField 'String', PERMISSIONS_SYSTEM_SYMBOL, '"GALA"';
buildConfigField 'String', REST_API_URL, '"http://bview.bezeq.com/gala"';
manifestPlaceholders = [appName: "BVieW"]
}
preprod {
initWith release
applicationIdSuffix ".preprod"
manifestPlaceholders = [appName: "BVieW PreProd"]
}
}
flavorDimensions "version"
productFlavors {
regular {
dimension "version"
}
skip_login {
dimension "version"
}
}
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}
}
repositories {
maven { url "https://mint.splunk.com/gradle/" }
maven { url "https://repo.spring.io/release" }
jcenter()
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//multidex suppport for android < 5.0
implementation 'androidx.multidex:multidex:2.0.1'
//design stuff
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
//google stuff
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.libraries.places:places-compat:2.2.0'
//mint (crash report & statistics)
implementation 'com.splunk.mint:mint:4.0.9'
//spring framework
implementation 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
implementation 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.7.2'
//sliding panel
implementation 'com.sothree.slidinguppanel:library:3.3.1'
//circle image
implementation 'de.hdodenhof:circleimageview:2.1.0'
//usb serial connection
implementation 'com.github.felHR85:UsbSerial:4.5'
}