Is anyone receiving this runtime exception?
java.lang.IllegalArgumentException: No enum constant com.facebook.appevents.codeless.internal.EventBinding.MappingMethod.BUTTON_INDEXING
at java.lang.Enum.valueOf(Enum.java:257)
at com.facebook.appevents.codeless.internal.EventBinding$MappingMethod.valueOf(EventBinding.java:154)
at com.facebook.appevents.codeless.internal.EventBinding.getInstanceFromJson(EventBinding.java:82)
at com.facebook.appevents.codeless.internal.EventBinding.parseArray(EventBinding.java:69)
at com.facebook.appevents.codeless.CodelessMatcher$ViewMatcher.run(CodelessMatcher.java:224)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
We are using implementation 'com.facebook.android:facebook-android-sdk:4.37.0'
I've tried the newest version 4.39.0, but it also doesn't work. For some reason 4.33.0, however, does work. The issue started at around 8pm UTC
Related
My deployed AWS API Gateway has one endpoint:
/users with a DELETE Method. I'm trying to call this method from my android app using a generated SDK.
I have deployed the API, then generated the SDK in the API Gateway console and downloaded my zip folder named aws-apigateway-api-sdk-1.0.0. I then ran 'mvn install' inside the folder and copied the generated .jar file and libs into my project and added the gradle imports (basically I did everything as in these instructions until point 7).
Now I want to create the SDK in my android code. In the instructions they do it this way:
// Create an instance of your SDK. Here, 'SimpleCalcClient.java' is the compiled java class for the SDK generated by API Gateway.
final SimpleCalcClient client = factory.build(SimpleCalcClient.class);
My problem is this SimpleCalcClient.class -> I know I need to replace this with my own value, but in my generated target folder I only found following class named LambdaSimpleProxyClient.class, which is an interface. This doesnt seem to be the right class though:
I still tried to use the ApiClientFactory with this class, right now my code looks like this:
public void deleteUser(View view) {
ApiClientFactory factory = new ApiClientFactory();
final LambdaSimpleProxyClient client = factory.build(LambdaSimpleProxyClient.class);
client.usersDelete();
}
The LambdaSimpleProxyClass.java was generated in step 5 when I ran mvn install, it has the method usersDelete() in it, which makes sense to me because that fits with how I called my API Endpoint and looks kinda promising, but I don't rally think that's the class I should use here (but there was no other .class file in my zip folder that was generated by the API Gateway Generate SDK Method:
/**
*
*
* #return Empty
*/
#com.amazonaws.mobileconnectors.apigateway.annotation.Operation(path = "/users", method = "DELETE")
Empty usersDelete();
I also don't understand how to pass my query parameter username in here, but I still tried to call this method. The program then crashes at client.usersDelete();
So what else than LambdaSimpleProxyClient.class should I use there? There is no other .class file in my generated zip folder aws-apigateway-api-sdk-1.0.0 or in my by maven generated target folder.
2020-12-21 20:59:32.427 5340-5340/de.stuttgart.syzl3000 D/ProfileActivity: deleteAccount: delete Btn clicked
2020-12-21 20:59:32.441 5340-5340/de.stuttgart.syzl3000 D/AndroidRuntime: Shutting down VM
2020-12-21 20:59:32.445 5340-5340/de.stuttgart.syzl3000 E/AndroidRuntime: FATAL EXCEPTION: main
Process: de.stuttgart.syzl3000, PID: 5340
java.lang.IllegalStateException: Could not execute method for android:onClick
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:414)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:409)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: com.amazonaws.mobileconnectors.apigateway.ApiClientException: (Service: null; Status Code: 0; Error Code: null; Request ID: null)
at com.amazonaws.mobileconnectors.apigateway.ApiClientHandler.invoke(ApiClientHandler.java:118)
at java.lang.reflect.Proxy.invoke(Proxy.java:913)
at $Proxy1.usersDelete(Unknown Source)
at de.stuttgart.syzl3000.menu.ProfileActivity.deleteAccount(ProfileActivity.java:49)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:409)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1448)
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:102)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:90)
at java.net.InetAddress.getAllByName(InetAddress.java:787)
at com.android.okhttp.Dns$1.lookup(Dns.java:39)
at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:175)
at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:141)
at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:83)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:174)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseMessage(HttpURLConnectionImpl.java:534)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseMessage(DelegatingHttpsURLConnection.java:109)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseMessage(Unknown Source:0)
at com.amazonaws.http.UrlHttpClient.createHttpResponse(UrlHttpClient.java:92)
at com.amazonaws.http.UrlHttpClient.execute(UrlHttpClient.java:85)
at com.amazonaws.mobileconnectors.apigateway.ApiClientHandler.invoke(ApiClientHandler.java:109)
at java.lang.reflect.Proxy.invoke(Proxy.java:913)
at $Proxy1.usersDelete(Unknown Source)
at de.stuttgart.syzl3000.menu.ProfileActivity.deleteAccount(ProfileActivity.java:49)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:409)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Any hints are welcomed
I had to run the "Generate SDK" in my API Gateway Console again, because somehow the query parameter that I added wasn't in the deployed version. After deploying it again and generating a new SDK, I moved the unzipped folder aws-apigateway-api-sdk-1.0.0 into my app folder. Then the LambdaSimpleProxyClient.class was automatically recognised in the factory.build(LambdaSimpleProxyClient.class) call and I was able to pass the query parameter into the client.deleteUser("<my-username-value>") method that now accepted a passed in String parameter.
There's still an error, but I'll open a new question for that.
I make a simple app, that uses http. For debug previously I used Chuck library. But now, when I try to open http-package from Chuck I get exception and I don't understand why.
You can see the project here: https://github.com/FirstSpectr/Sandbox
Process: ru.spectr.kotlinsandbox, PID: 4699
java.lang.IncompatibleClassChangeError: Class 'com.readystatesoftware.chuck.internal.ui.TransactionActivity' does not implement interface 'androidx.lifecycle.LifecycleOwner' in call to 'androidx.lifecycle.Lifecycle androidx.lifecycle.LifecycleOwner.getLifecycle()' (declaration of 'androidx.lifecycle.LiveData' appears in /data/app/ru.spectr.kotlinsandbox-cFhy1fESF3ecXGlmQrM-Yg==/base.apk!classes2.dex)
at androidx.lifecycle.LiveData.observe(LiveData.java:172)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setCallback(LoaderManagerImpl.java:100)
at androidx.loader.app.LoaderManagerImpl.createAndInstallLoader(LoaderManagerImpl.java:400)
at androidx.loader.app.LoaderManagerImpl.initLoader(LoaderManagerImpl.java:421)
at com.readystatesoftware.chuck.internal.ui.TransactionActivity.onCreate(TransactionActivity.java:91)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)```
I found problem dependency:
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
After deleted chuck work fine
I am facing two inter related issue,
I am facing following issue in Android Oreo device,
java.lang.RuntimeException: Error receiving broadcast Intent { act=com.example.bluetooth.le.ACTION_REMOTE_RSSI_UPDATED flg=0x10 (has extras) } in com.linka.linkaapikit.module.widget.LockGattUpdateReceiver$1#762cfd9
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52197(LoadedApk.java:1315)
at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.$m$7(Unknown Source:4)
at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run(Unknown Source:39)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:172)
at android.app.ActivityThread.main(ActivityThread.java:6590)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.SecurityException: Failed to find provider null for user 0; expected to find a valid ContentProvider for this authority
at android.os.Parcel.readException(Parcel.java:2005)
at android.os.Parcel.readException(Parcel.java:1951)
at android.content.IContentService$Stub$Proxy.notifyChange(IContentService.java:801)
at android.content.ContentResolver.notifyChange(ContentResolver.java:2049)
at android.content.ContentResolver.notifyChange(ContentResolver.java:2000)
at android.content.ContentResolver.notifyChange(ContentResolver.java:1970)
at com.activeandroid.Model.save(Model.java:162)
After that i find following solutions,
add in Android Manifest
<provider
android:name="com.activeandroid.content.ContentProvider"
android:authorities="com.myapp"
android:enabled="true"
android:exported="false"
/>
But after adding this line i got another issue that are following,
java.lang.IncompatibleClassChangeError: Superclass org.apache.http.params.BasicHttpParams of org.apache.http.params.SyncBasicHttpParams is declared final (declaration of 'org.apache.http.params.SyncBasicHttpParams' appears in /data/app/com.kolonishare-6KsxqUHOK_Q45cGI0D0bHg==/base.apk:classes16.dex)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at com.activeandroid.ModelInfo.scanForModelClasses(ModelInfo.java:187)
at com.activeandroid.ModelInfo.scanForModel(ModelInfo.java:152)
at com.activeandroid.ModelInfo.<init>(ModelInfo.java:63)
at com.activeandroid.Cache.initialize(Cache.java:66)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:44)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:34)
at com.activeandroid.content.ContentProvider.onCreate(ContentProvider.java:39)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1919)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1894)
at android.app.ActivityThread.installProvider(ActivityThread.java:6285)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5851)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5772)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
I clean and also rebuild project, invalidate restart but getting same error.
you need put your xml in this
<provider android:name="com.activeandroid.content.ContentProvider"
android:authorities="${applicationId}.fileprovider"
android:enabled="true"
android:exported="false" />
Since API 26 SensorDirectChannel is available to use for possible faster sample rates.
It can be used with MemoryFile or HardwareBuffer as Buffer.
I get IOExceptions with both while trying to create the Channel. I tried as following:
SensorManager sm = (SensorManager)getSystemService(Service.SENSOR_SERVICE);
MemoryFile memFile = null;
try {
memFile = new MemoryFile("AccMemoryFile", 1040);
} catch (Exception e) {
e.printStackTrace();
}
SensorDirectChannel channel = sm.createDirectChannel(memFile);
I get the following message:
02-26 15:15:46.477 10323-10323/de.makos.directchaneltest E/AndroidRuntime: FATAL EXCEPTION: main
Process: de.makos.directchaneltest, PID: 10323
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.makos.directchaneltest/de.makos.directchaneltest.MainActivity}: java.io.UncheckedIOException: java.io.IOException: create MemoryFile direct channel failed -12
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.io.UncheckedIOException: java.io.IOException: create MemoryFile direct channel failed -12
at android.hardware.SystemSensorManager.createDirectChannelImpl(SystemSensorManager.java:587)
at android.hardware.SensorManager.createDirectChannel(SensorManager.java:904)
at de.makos.directchaneltest.MainActivity.onCreate(MainActivity.java:37)
at android.app.Activity.performCreate(Activity.java:7044)
at android.app.Activity.performCreate(Activity.java:7035)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.io.IOException: create MemoryFile direct channel failed -12
at android.hardware.SystemSensorManager.createDirectChannelImpl(SystemSensorManager.java:588)
at android.hardware.SensorManager.createDirectChannel(SensorManager.java:904)
at de.makos.directchaneltest.MainActivity.onCreate(MainActivity.java:37)
at android.app.Activity.performCreate(Activity.java:7044)
at android.app.Activity.performCreate(Activity.java:7035)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
With the HardwareBuffer I got a similar Exception.
Code:
HardwareBuffer accHawBuff = HardwareBuffer.create(1040, 1, HardwareBuffer.BLOB, 1, HardwareBuffer.USAGE_SENSOR_DIRECT_DATA);
SensorDirectChannel channel= sm.createDirectChannel(accHawBuff);
Exception Message:
02-26 15:27:07.592 10774-10774/de.makos.brakelightdatacollector E/AndroidRuntime: FATAL EXCEPTION: main
Process: de.makos.brakelightdatacollector, PID: 10774
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.makos.brakelightdatacollector/de.makos.brakelightdatacollector.MainActivity}: java.io.UncheckedIOException: java.io.IOException: create HardwareBuffer direct channel failed -12
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.io.UncheckedIOException: java.io.IOException: create HardwareBuffer direct channel failed -12
at android.hardware.SystemSensorManager.createDirectChannelImpl(SystemSensorManager.java:612)
at android.hardware.SensorManager.createDirectChannel(SensorManager.java:927)
at de.makos.brakelightdatacollector.MesseinheitDirectChanel.registerListener(MesseinheitDirectChanel.java:63)
at de.makos.brakelightdatacollector.MainActivity.onCreate(MainActivity.java:64)
at android.app.Activity.performCreate(Activity.java:7044)
at android.app.Activity.performCreate(Activity.java:7035)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.io.IOException: create HardwareBuffer direct channel failed -12
at android.hardware.SystemSensorManager.createDirectChannelImpl(SystemSensorManager.java:613)
at android.hardware.SensorManager.createDirectChannel(SensorManager.java:927)
at de.makos.brakelightdatacollector.MesseinheitDirectChanel.registerListener(MesseinheitDirectChanel.java:63)
at de.makos.brakelightdatacollector.MainActivity.onCreate(MainActivity.java:64)
at android.app.Activity.performCreate(Activity.java:7044)
at android.app.Activity.performCreate(Activity.java:7035)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
As there are no examples or other documentation for the usage of Direct Channels I am not sure if I maybe missed something. I tried it on a real and a virtual device, both running Oreo 8.1 (API 27).
I looked a little bit into the native function but i could not find a reason.I also could not figure out what the -12 means.
I hope someone can clarify this.
Thanks in advance
bro, I think the reason that cause this issue is that your device doesn't support SensorDirectChannel.
I recently encountered a similar problem that I can't create a SensorDirectChannel by passing a MemoryFile instance with almost same Logcat information as what you got, but I CAN have it done by passing a HardwareBuffer instance, weird.
After checking some docs I found the reason from this site.
And the item 7.3.9 say:
Blockquote
If device implementations include direct sensor support, they:
[C-3-1] MUST correctly declare support of direct channel types and direct report rates level through the isDirectChannelTypeSupported and getHighestDirectReportRateLevel API.
[C-3-2] MUST support at least one of the two sensor direct channel types for all sensors that declare support for sensor direct channel
TYPE_HARDWARE_BUFFER
TYPE_MEMORY_FILE
SHOULD support event reporting through sensor direct channel for primary sensor (non-wakeup variant) of the following types:
TYPE_ACCELEROMETER
TYPE_ACCELEROMETER_UNCALIBRATED
TYPE_GYROSCOPE
TYPE_GYROSCOPE_UNCALIBRATED
TYPE_MAGNETIC_FIELD
TYPE_MAGNETIC_FIELD_UNCALIBRATED
So, obviously the sensor vendor must make their sensor support the TYPE_HARDWARE_BUFFER SensorDirectChannel or TYPE_MEMORY_FILE SensorDirectChannel or both of them, or you cannot make use of them.
At last, I check the acceleration sensor of my device (Pixel2) via isDirectChannelTypeSupported and got an expected result as follows:
resultscreenshot.
Hope it can help you.
Btw, my English is not so good. Apologize if it makes you confused.
In a recent update we began seeing 2 crashes coming from Firebase. Neither of these crashes are reproducible, and they happen pretty infrequently, but frequently enough for us to be concerned. The first one appear 99% of the time on Android 7 (1% on Android 5):
Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) } in com.google.firebase.iid.f#96947cd
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1132)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkInfo.isConnected()' on a null object reference
at com.google.firebase.iid.zzad.zzchp(Unknown Source)
at com.google.firebase.iid.zzae.onReceive(Unknown Source)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1122)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
And this one comes exclusively from Android 8:
Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) } in com.google.firebase.iid.f#8746d6a
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52497(LoadedApk.java:1323)
at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.$m$7(Unknown Source:4)
at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run(Unknown Source:39)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkInfo.isConnected()' on a null object reference
at com.google.firebase.iid.zzad.zzchp(Unknown Source:24)
at com.google.firebase.iid.zzae.onReceive(Unknown Source:7)
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52497(LoadedApk.java:1313)
at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.$m$7(Unknown Source:4)
at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run(Unknown Source:39)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Unfortunately the Firebase SDK is obfuscated so I can't see the full context of the crash, but the exception being thrown is an NPE on a NetworkInfo object trying to perform the isConnected method.
These are the firebase libs we are using in this build:
api "com.google.firebase:firebase-config:11.6.2"
api "com.firebase:firebase-jobdispatcher:0.8.4"
We upgraded the firebase-config lib from 11.2.0 to 11.6.2 and added the jobdispatcher lib between the previous release and this new release where we began seeing the crash. I've searched around but haven't seen any existing conversations about the issue, if anyone has insight we'd really appreciate it. Thanks!
I got an official answer from the firebase team to the bug report I sent concerning this issue:
Yes, you are right. This is currently an issue from Firebase SDK 11.6.0 onwards.
Our engineers are currently working on a fix for this issue, but I can't share any details or timelines at this time.
In the meantime, I would suggest you to use the older version of the Firebase SDK.
You may check our release notes for any further updates.
Had same issue. Fixed in Firebase SDK 11.8.0.
Also checked the release notes:
SDK Version 11.8.0 - December 18, 2017
Cloud Messaging
Fixed an internal NullPointerException caused by a call to NetworkInfo.isConnected().