Please help us to fix issues asap:
Issue Basics
- ObjectBox version : 1.5.0
- Reproducibility: always
Reproducing the bug
Description
This issue started occurring only after upgrading to Android Studio v3.1.3 from v3.1.2.
Code
Occurs whenever i try to access the Box for my Product
prodBox.all.size == 0
Logs & stackstraces
Stacktrace:
Process: com.gfxbandits.invizio, PID: 4412
java.lang.VerifyError: Verifier rejected class com.gfxbandits.invizio.model.ProductCursor: long com.gfxbandits.invizio.model.ProductCursor.put(com.gfxbandits.invizio.model.Product) failed to verify: long com.gfxbandits.invizio.model.ProductCursor.put(com.gfxbandits.invizio.model.Product): [0x50A] register v256 has type Undefined but expected Integer (declaration of 'com.gfxbandits.invizio.model.ProductCursor' appears in /data/app/com.gfxbandits.invizio-1/split_lib_slice_0_apk.apk)
at com.gfxbandits.invizio.model.ProductCursor$Factory.createCursor(ProductCursor.java:21)
at io.objectbox.Transaction.createCursor(Transaction.java:166)
at io.objectbox.Box.getReader(Box.java:81)
at io.objectbox.Box.getAll(Box.java:320)
at com.gfxbandits.invizio.fragment.CatalogueFragment$loadCatalogueOnline$1$1.onComplete(CatalogueFragment.kt:203)
at com.google.android.gms.tasks.zzj.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
Entities
Product.kt:
import android.os.Parcelable
import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id
import io.objectbox.annotation.Index
import kotlinx.android.parcel.Parcelize
@Parcelize
@Entity
data class Product(@Id var id: Long = 0,
var isSynced: Boolean = false,
@Index var RFID: String = "",
@Index var SKU: String = "",
@Index var designNo: String = "",
@Index var imageName: String = "",
@Index var status: String = STATUS_IN_STOCK,
var salesManName: String = "",
@Index var type: String = "",
@Index var size: String = "",
@Index var grossWeight: String = "",
@Index var netWeight: String = "",
@Index var collectionLine: String = "",
@Index var category: String = "",
@Index var metalType: String = "",
@Index var metalPurity: String = "",
var metalWeight: String = "",
var totalDiamondWeight: String = "",
var totalStoneWeight: String = "",
var centerStoneType: String = "",
var centerStoneShape: String = "",
var centerStoneSize: String = "",
var centerStoneQuality: String = "",
var centerStoneColor: String = "",
var centerStoneWeight: String = "",
var centerStoneCertificate: String = "",
var centerStoneCut: String = "",
var stoneType: String = "",
var stoneShape: String = "",
var stoneSize: String = "",
var stoneQuality: String = "",
var stoneColor: String = "",
var stoneCount: String = "",
var stoneWeight: String = "",
var stoneCertificate: String = "",
var stoneCut: String = "",
var totalStoneCount: String = "",
var findingType: String = "",
var findingMetal: String = "",
var findingWeight: String = "",
var findingMetalPurity: String = "",
var goldLock: String = "",
var silverLock: String = "",
var platinumLock: String = "",
var costPrice: String = "",
var fobPrice: String = "",
var sellingPrice: String = "",
var metalPrice: String = "",
var diamondPrice: String = "",
var stonePrice: String = "",
var laborPrice: String = "",
var laborChargePerGram: String = "",
var setID: String = "",
var setImageName: String = "",
var company: String = "",
var location: String = "",
var counterNumber: String = "",
var counterDescription: String = "",
var trayNumber: String = "",
var trayDescription: String = "",
var owner: String = "",
var customer: String = "",
var reserved1: String = "",
var reserved2: String = "",
var reserved3: String = "",
var reserved4: String = "",
var reserved5: String = "",
var reserved6: String = "",
var reserved7: String = "",
var reserved8: String = "",
var reserved9: String = "",
var reserved10: String = "",
@Index var isSelected: Boolean = true,
@Index var isNewlyImported: Boolean = false
) : Parcelable {
companion object {
val STATUS_IN_STOCK = "INSTOCK"
val STATUS_SALES_OUT = "SALESOUT"
val STATUS_SOLD = "SOLD"
}
}
Misc
I also tried from Android Studio 3.2 Canary 17 but it still doesn't work.
The app works normally if i downgrade to the last APK Built from Android Studio 3.1.2 (code is still same).
I even tried disabling R8 by adding the following line to gradle.properties
android.enableR8 = false
I am using the following dependencies/libraries:
-Apache POI for Android 3.12
ext {
kotlin_version = '1.2.41'
support_lib_version = '27.1.1'
google_services_version = '15.0.0'
firebase_version = '15.0.0'
objectboxVersion = '1.5.0'
as_version='3.2.0-alpha17'
}
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "com.android.support:appcompat-v7:$support_lib_version"
implementation "com.android.support:recyclerview-v7:$support_lib_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation "com.android.support:support-v4:$support_lib_version"
implementation "com.android.support:design:$support_lib_version"
implementation "com.android.support:support-vector-drawable:$support_lib_version"
implementation 'com.android.support:support-v4:27.1.1'
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.github.florent37:runtime-permission-kotlin:1.0.1'
implementation 'br.com.simplepass:loading-button-android:1.14.0'
implementation 'com.amitshekhar.android:android-networking:1.0.1'
implementation "com.google.firebase:firebase-core:$firebase_version"
implementation "com.google.firebase:firebase-firestore:$firebase_version"
implementation "com.google.firebase:firebase-storage:$firebase_version"
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.3'
implementation "io.objectbox:objectbox-android:$objectboxVersion"
implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
kapt "io.objectbox:objectbox-processor:$objectboxVersion"
implementation 'com.jakewharton:butterknife:8.8.1'
kapt 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.github.ghost1372:Mzip-Android:0.4.0'
implementation 'com.shuhart.stepview:stepview:1.2.7'
implementation 'com.appyvet:materialrangebar:1.4.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.firebaseui:firebase-ui-storage:3.3.1'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.h6ah4i.android.widget.verticalseekbar:verticalseekbar:0.7.2'
implementation 'com.github.ohoussein.playpauseview:playpauseview:1.0.2'
implementation 'com.github.Ilhasoft:data-binding-validator:1.0.0'
kapt "androidx.databinding:databinding-compiler:$as_version"
implementation 'com.cloudrail:cloudrail-si-android:2.22.1'
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.lowagie:itext:4.2.1'
implementation 'com.github.medyo:fancybuttons:1.8.4'