Comments (10)
Thanks for looking into this! Love this library!!
from kotpref.
Is this happen on only UI tests? Is your UI tests espresso?
from kotpref.
from kotpref.
I tried UI test of your project, and failed test with another error below.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.ligi.gobandroid_hd, PID: 4958
java.lang.RuntimeException: Unable to create application org.ligi.gobandroid_hd.TestApp: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
at org.ligi.gobandroid_hd.ui.GoPrefs.getThemeInt(GoPrefs.kt:73)
at org.ligi.gobandroid_hd.App.onCreate(App.java:41)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.support.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:323)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I don't know it is the issue of kotpref, but Kotlin 1.1.1 seems having some bugs of androidTest.
So, I will investigate it continuously and watch kotlin issues.
Thanks
from kotpref.
Reading the diff - this might be a fix for the problem : JetBrains/kotlin@132393c
so it might have been this kotlin problem and just surfaced at kotpref for me - so waiting for 1.1.2 - feel free to close.
from kotpref.
I found the cause of this problem. I call java 8 function Map#forEach
at KotprefPreference
I'll fix it as soon as possible. Sorry.
from kotpref.
Fixed this issue in latest version 2.1.1!
Thanks! :)
from kotpref.
I can confirm that the ClassDefNotFound is fixed in 2.1.1 - thanks! - unfortunately now on another emulator (differend SDK-level) I a similar NullPointer you mentioned:
appCrashed: org.ligi.gobandroid_hd:10429 java.lang.NullPointerException java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference java.lang.RuntimeException: Unable to create application org.ligi.gobandroid_hd.TestApp: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at org.ligi.gobandroid_hd.ui.GoPrefs.isTransitionDone(GoPrefs.kt)
at org.ligi.gobandroid_hd.ui.application.GobandroidSettingsTransition.transition(GobandroidSettingsTransition.java:25)
at org.ligi.gobandroid_hd.App.onCreate(App.java:30)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.support.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:323)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
... 8 more
isTransition looks like this:
var isTransitionDone: Boolean by booleanPref(default = false)
not yet sure how this can be null yet
from kotpref.
Oh... I'll investigate it :(
from kotpref.
@chibatching
I'm experiencing NoClassDefFoundError
when using blockingBulk
on Android 6.0 or lower. I think that similar change to this one in #44 should be also done for commit
function in the same file.
Edit: Submitted a pull request at #53
from kotpref.
Related Issues (20)
- KotPref + applicationIdSuffix not working HOT 2
- Crash on latest library version if I compose delegates HOT 7
- How is proguard and code obfuscation solved? HOT 1
- unit test with viewModels uses kotpref HOT 1
- Add support for EncryptedSharedPreferences HOT 2
- Clear() does not work with EncryptedSharedPreferences HOT 4
- Auto update API docs with CI
- When mocking, the values are not initialized and mock returns default HOT 2
- create a new XXXPref object every time,can the same object be used? HOT 1
- Do you plan to support Jetpack DataStore? HOT 1
- LiveData - fires twice upon first subscription HOT 1
- if I using moshi, is it good idea to serialize model with moshi and save by stringPref? HOT 1
- Change value type HOT 1
- Migrate from JCenter to Maven Central HOT 3
- If a key is composed of fixed + dynamic parts, what to do? HOT 2
- How to migrate to DataStore? HOT 2
- Codecov uploader don't work after dependencies update
- NPE on livedata-support when calling clear()
- livedata is not notify when clearing on API < 30
- Featur Request -> Save data class HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotpref.