Comments (5)
Just from that trace I think the problem may be that you are registering some Connectable
while some network change is being notified to the ones previously registered. Could you provide some example to look further?
from merlin.
Given that it comes from a PingTask
it seems unlikely that this code is at fault. As you said @EBfVince you have just copied the demo. It seems that this could happen should a ping task callback when attempting to clear the registrations when unbinding
merlin.
from merlin.
Yes, it seems that the underlying connectable collection could be modified while notifying those Connectable
and it causes the mentioned Exception
. I've tried to create a test for such condition and a possible fix for that.
from merlin.
My class using Merlin :
public class ManageInternet implements LoaderManager.LoaderCallbacks<Boolean>,
Connectable, Disconnectable {
// ...
private final Merlin merlin;
private final MerlinsBeard merlinsBeard;
// ...
public ManageInternet(@NonNull MyActivity activity) {
// INTERNET Merlin
this.merlin = new Merlin.Builder()
.withConnectableCallbacks()
.withDisconnectableCallbacks()
.build(vinceActivity2);
this.merlin.registerConnectable(this);
this.merlin.registerDisconnectable(this);
this.merlinsBeard = MerlinsBeard.from(activity);
// ...
}
// ...
public void bindMerlin() {
merlin.bind();
if (merlinsBeard.isConnected())
onConnect();
else
onDisconnect();
}
public void unbindMerlin() {
merlin.unbind();
internetStateChanged = true;
}
...
}
In my activity class :
public abstract class MyActivity extends AppCompatActivity {
// ...
private ManageInternet mi;
@Override
@CallSuper
protected void onCreate(@Nullable Bundle savedInstanceState) {
// ...
// INTERNET
mi = new ManageInternet (this);
// ...
}
@Override
@CallSuper
protected void onResume() {
super.onResume();
// INTERNET (désabonne dans le onPause())
gl.bindMerlin();
}
@Override
@CallSuper
protected void onPause() {
// INTERNET
gl.unbindMerlin();
super.onPause();
}
}
"MyActivity" is the abstract class that all my other activities depend.
"ManageInternet" helps to load data from internet when the connection is available.
This error is not critical, I just had one crash few days ago on one of my users.
On firebase, crashlytics doest not give me informations about where my code launched your code.
I will give you more informations in the future if this error raise again.
from merlin.
This should be already fixed in #183
from merlin.
Related Issues (20)
- Manifest Unresolved Class error on Service HOT 4
- Expand the Merlin demo
- Technical Data Questionnaire Wiki Page HOT 1
- The onConnected event fires when first run it HOT 3
- IllegalStateException - You must call canNotify() before calling notify(ConnectivityChangeEvent)
- Android 9.0 Testing HOT 4
- Remove releases folder from repo HOT 1
- Integration tests
- not getting Wifi connected callback HOT 1
- java.lang.NoClassDefFoundError: on API 28 App crashes HOT 5
- Not working in One plus 5t HOT 6
- Mobile connection type enhancements
- Only disconnect is fired when switching from say wifi to mobile connection HOT 6
- Crash HOT 14
- registerConnectable is not able to work after flight mode for a while
- Custom RequestMaker HOT 2
- NPE on ConnectivityCallbacks.notifyMerlinService HOT 1
- How to get internet speed ?
- Migrate from JCenter 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 merlin.