Android javafxports NullPointerException - android

I'm getting a force close crash on a small Android app I made for school using Javafxports.
Here is the code and APKs
And the logcat returns this exception:
E/AndroidRuntime( 4474): FATAL EXCEPTION: JavaFX Application Thread
E/AndroidRuntime( 4474): Process: com.julioqc.superflush, PID: 4474
E/AndroidRuntime( 4474): java.lang.NullPointerException
E/AndroidRuntime( 4474): at com.sun.glass.ui.monocle.MonocleWindowManager$1.run(MonocleWindowManager.java:179)
E/AndroidRuntime( 4474): at com.sun.javafx.application.PlatformImpl.lambda$null$155(PlatformImpl.java:295)
E/AndroidRuntime( 4474): at com.sun.javafx.application.PlatformImpl$$Lambda$19.run(Unknown Source)
E/AndroidRuntime( 4474): at java.security.AccessController.doPrivileged(AccessController.java:52)
E/AndroidRuntime( 4474): at com.sun.javafx.application.PlatformImpl.lambda$runLater$156(PlatformImpl.java:294)
E/AndroidRuntime( 4474): at com.sun.javafx.application.PlatformImpl$$Lambda$6.run(Unknown Source)
E/AndroidRuntime( 4474): at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
E/AndroidRuntime( 4474): at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
E/AndroidRuntime( 4474): at java.lang.Thread.run(Thread.java:841)
I/cm.log.servpro( 1334): [Privacy]/ com.google.android.googlequicksearchbox is not in contact list
W/ActivityManager( 726): Force finishing activity com.julioqc.superflush/javafxports.android.FXActivity
What is causing this error in my code??
EDIT: found out the issue is caused by some unsupported JavaFX 8 dialogs. Trying alternative.

Related

React Native App Crashes on Launch in Android (API 19)

Description
I have created a project with react-native-cli
When I launch the app using the command "react-native run-android" on Devices and Emulators with Android API level 21+ App is launching.
But for devices less than API 21, the app crashing on launch.
I have specified in android Gradle minSdk version to 16.
I viewed the stack trace using "adb logcat" the crash was due to OkHttp3 that is used internally in Facebook Flipper, which is expecting API 21+.
I haven't used any OkHttp3 Dependency explicitly in my app
React Native version:
6.14.4
Steps To Reproduce
Create a project using react-native CLI not Expo CLI
Navigate to the project folder
Connect a device or an emulator with API less than 21
run command "react-native run-android" to run the app on the connected device
Expected Results
The app should launch without any crash.
Android Logs
E/AndroidRuntime( 3745): java.lang.RuntimeException: Unable to create application com.infifive.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created
E/AndroidRuntime( 3745): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4347)
E/AndroidRuntime( 3745): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime( 3745): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime( 3745): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3745): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 3745): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 3745): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3745): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 3745): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 3745): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 3745): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 3745): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90)
E/AndroidRuntime( 3745): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238)
E/AndroidRuntime( 3745): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281)
E/AndroidRuntime( 3745): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87)
E/AndroidRuntime( 3745): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39)
E/AndroidRuntime( 3745): at com.infifive.MainApplication.onCreate(MainApplication.java:47)
E/AndroidRuntime( 3745): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime( 3745): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
E/AndroidRuntime( 3745): ... 10 more
E/AndroidRuntime( 3745): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 3745): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 3745): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80)
E/AndroidRuntime( 3745): ... 17 more
E/AndroidRuntime( 3745): Caused by: java.lang.ExceptionInInitializerError
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient.newSslSocketFactory(OkHttpClient.java:263)
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:229)
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183)
E/AndroidRuntime( 3745): ... 20 more
E/AndroidRuntime( 3745): Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
E/AndroidRuntime( 3745): at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:238)
E/AndroidRuntime( 3745): at okhttp3.internal.platform.Platform.findPlatform(Platform.java:202)
E/AndroidRuntime( 3745): at okhttp3.internal.platform.Platform.<clinit>(Platform.java:79)`
The only way I found to fix it is by commenting out all the code associated with flipper
GH thread here
This happens because of an internal check in the library called "okhttp" where the newer versions are supporting only API 21 and above. If possible, reduce the okhttp version, or anything related to it such as Glide or Retrofit etc. That will solve your problem.

Compiling react-native fork on Android ICS: java.lang.NoClassDefFoundError: com/facebook/react/uimanager/ReactProp

I'm working on a fork for React-Native with Android ICS support.
I have trouble running right now on Android 4.0.3, I am working on Ubuntu 14.04 64bit.
Here is what I have done (according to the following instructions: https://facebook.github.io/react-native/docs/android-building-from-source.html):
forked react-native so I had my own
Added compatibility stuff to start with (link: https://github.com/CodeBuffet/react-native/tree/ics-compat, on the ics-compat branch)
tested locally on android 4.0.3
After working away some errors I had because of the low version, I came across the following error, and was wondering if you guys knew what it was.
I think it has something to do with the fact that it's trying to look for com/facebook/react/uimanager/ReactProp which doesn't exists in the project (but com.facebook.react.uimanager.annotations.ReactProp does).
E/AndroidRuntime( 1270): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime( 1270): at android.os.AsyncTask$3.done(AsyncTask.java:278)
E/AndroidRuntime( 1270): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
E/AndroidRuntime( 1270): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
E/AndroidRuntime( 1270): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
E/AndroidRuntime( 1270): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/AndroidRuntime( 1270): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
E/AndroidRuntime( 1270): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
E/AndroidRuntime( 1270): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
E/AndroidRuntime( 1270): at java.lang.Thread.run(Thread.java:856)
E/AndroidRuntime( 1270): Caused by: java.lang.NoClassDefFoundError: com/facebook/react/uimanager/ReactProp
E/AndroidRuntime( 1270): at java.lang.reflect.Method.getAnnotation(Native Method)
E/AndroidRuntime( 1270): at java.lang.reflect.Method.getAnnotation(Method.java:275)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.ViewManagersPropertyCache.extractPropSettersFromViewManagerClassDefinition(ViewManagersPropertyCache.java:400)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.ViewManagersPropertyCache.getNativePropSettersForViewManagerClass(ViewManagersPropertyCache.java:301)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.<init>(ViewManagerPropertyUpdater.java:116)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.<init>(ViewManagerPropertyUpdater.java:110)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.ViewManagerPropertyUpdater.findManagerSetter(ViewManagerPropertyUpdater.java:73)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.ViewManagerPropertyUpdater.getNativeProps(ViewManagerPropertyUpdater.java:60)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.ViewManager.getNativeProps(ViewManager.java:199)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.UIManagerModuleConstantsHelper.createConstants(UIManagerModuleConstantsHelper.java:62)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.UIManagerModule.createConstants(UIManagerModule.java:128)
E/AndroidRuntime( 1270): at com.facebook.react.uimanager.UIManagerModule.<init>(UIManagerModule.java:80)
E/AndroidRuntime( 1270): at com.facebook.react.CoreModulesPackage.createNativeModules(CoreModulesPackage.java:68)
E/AndroidRuntime( 1270): at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:895)
E/AndroidRuntime( 1270): at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:812)
E/AndroidRuntime( 1270): at com.facebook.react.ReactInstanceManagerImpl.access$700(ReactInstanceManagerImpl.java:102)
E/AndroidRuntime( 1270): at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:198)
E/AndroidRuntime( 1270): at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:181)
E/AndroidRuntime( 1270): at android.os.AsyncTask$2.call(AsyncTask.java:264)
E/AndroidRuntime( 1270): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/AndroidRuntime( 1270): ... 5 more
E/AndroidRuntime( 1270): Caused by: java.lang.ClassNotFoundException: com.facebook.react.uimanager.ReactProp
E/AndroidRuntime( 1270): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/AndroidRuntime( 1270): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime( 1270): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime( 1270): ... 25 more
W/ActivityManager( 875): Force finishing activity com.ma3akom/.MainActivity
Some info:
Why are you trying to introduce support for such an old Android version?
Because I am making an app whose users are 90% Android ICS users. We already started working in React-Native without knowing this, so now I'm trying to make React-Native compatible with ICS so we dont have this issue anymore.
You may need extra work.
Please check https://github.com/facebook/react-native-website/issues/653 and https://github.com/facebook/react-native/issues/22118.

Crash at startup on port to Cordova Crosswalk (Android)

I'm porting an existing android cordova app to cordova crosswalk.
Using cordova 4, crosswalk-cordova-10.39.235.9-x86 and Android SDK 19
The app crashes at startup with the following logs in logcat:
D/AndroidRuntime( 7208): Shutting down VM
W/dalvikvm( 7208): threadid=1: thread exiting with uncaught exception (group=0x41caeda0)
E/AndroidRuntime( 7208): FATAL EXCEPTION: main
E/AndroidRuntime( 7208): Process: myapp.cqa, PID: 7208
E/AndroidRuntime( 7208): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 7208): at org.apache.cordova.CordovaActivity.makeWebView(CordovaActivity.java:295)
E/AndroidRuntime( 7208): at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:348)
E/AndroidRuntime( 7208): at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:323)
E/AndroidRuntime( 7208): at myapp.cqa.CordovaApp.onCreate(CordovaApp.java:31)
E/AndroidRuntime( 7208): at android.app.Activity.performCreate(Activity.java:5451)
E/AndroidRuntime( 7208): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
E/AndroidRuntime( 7208): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2358)
E/AndroidRuntime( 7208): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2452)
E/AndroidRuntime( 7208): at android.app.ActivityThread.access$900(ActivityThread.java:172)
E/AndroidRuntime( 7208): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1302)
E/AndroidRuntime( 7208): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 7208): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 7208): at android.app.ActivityThread.main(ActivityThread.java:5586)
E/AndroidRuntime( 7208): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7208): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 7208): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
E/AndroidRuntime( 7208): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
E/AndroidRuntime( 7208): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 7208): Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Use SharedXWalkView if you want to support shared mode
E/AndroidRuntime( 7208): at org.xwalk.core.ReflectionHelper.handleException(ReflectionHelper.java:233)
E/AndroidRuntime( 7208): at org.xwalk.core.ReflectionHelper.handleException(ReflectionHelper.java:237)
E/AndroidRuntime( 7208): at org.xwalk.core.ReflectionHelper.init(ReflectionHelper.java:132)
E/AndroidRuntime( 7208): at org.xwalk.core.ReflectionHelper.loadClass(ReflectionHelper.java:199)
E/AndroidRuntime( 7208): at org.xwalk.core.XWalkPreferences.setValue(XWalkPreferences.java:112)
E/AndroidRuntime( 7208): at org.apache.cordova.CordovaWebView.<clinit>(CordovaWebView.java:890)
E/AndroidRuntime( 7208): ... 18 more
E/AndroidRuntime( 7208): Caused by: java.lang.RuntimeException: Use SharedXWalkView if you want to support shared mode
E/AndroidRuntime( 7208): ... 23 more
Any idea why it crashes ?
OK, after a night of sleeping, I realized I was using x86 crosswalk instead of the ARM one. Sorry for the dumb issue post...

Android Expansion APK Exception on Download Library

I'm following the steps in the dev guide to implement the Google Marketplace (Play) Expansion files setup:
http://developer.android.com/guide/market/expansion-files.html
I'm at the section "Preparing to use the Downloader Library" where I've added the License Lib, Downloader lib and zip lib projects to eclipse and then as libs to my main project. When I running my project, it always throw the exception as follows:
E/AndroidRuntime( 3758): FATAL EXCEPTION: background thread
E/AndroidRuntime( 3758): Process: com.expandinghorizons, PID: 3758
E/AndroidRuntime( 3758): android.content.res.Resources$NotFoundException: String resource ID #0x7f040007
E/AndroidRuntime( 3758): at android.content.res.Resources.getText(Resources.java:244)
E/AndroidRuntime( 3758): at android.content.res.Resources.getString(Resources.java:330)
E/AndroidRuntime( 3758): at android.content.Context.getString(Context.java:346)
E/AndroidRuntime( 3758): at
com.google.android.vending.expansion.downloader.impl.DownloadNotification.onDownloadStateChanged
(DownloadNotification.java:133)
E/AndroidRuntime( 3758): at
com.google.android.vending.expansion.downloader.impl.DownloaderService$LVLRunnable$1.allow
(DownloaderService.java:837)
E/AndroidRuntime( 3758): at com.google.android.vending.licensing.LicenseValidator.handleResponse
(LicenseValidator.java:211)
E/AndroidRuntime( 3758): at com.google.android.vending.licensing.LicenseValidator.verify
(LicenseValidator.java:166)
E/AndroidRuntime( 3758): at
com.google.android.vending.licensing.LicenseChecker$ResultListener$2.run
(LicenseChecker.java:228)
E/AndroidRuntime( 3758): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 3758): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 3758): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 3758): at android.os.HandlerThread.run(HandlerThread.java:61)
Seems the exception is happened on the Google Download libs, how can I do with it? Any one has advice?
Thank you.
Had the same problem. You need to run the SDK Manager as administrator.

java.lang.RuntimeException: system server dead?

My appwidget crashes with following error:
E/AndroidRuntime( 5572): FATAL EXCEPTION: main
E/AndroidRuntime( 5572): java.lang.RuntimeException: Unable to start receiver com.android.mlweatherwidget.WeatherWidgetLarge: java.lang.RuntimeException: system server dead?
E/AndroidRuntime( 5572): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1805)
E/AndroidRuntime( 5572): at android.app.ActivityThread.access$2400(ActivityThread.java:117)
E/AndroidRuntime( 5572): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:981)
E/AndroidRuntime( 5572): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5572): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 5572): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 5572): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 5572): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 5572): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 5572): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 5572): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 5572): Caused by: java.lang.RuntimeException: system server dead?
E/AndroidRuntime( 5572): at com.android.mlhome.appwidget.AppWidgetManager.getAppWidgetIds(AppWidgetManager.java:375)
E/AndroidRuntime( 5572): at com.android.mlweatherwidget.WeatherWidgetLarge.onReceive(WeatherWidgetLarge.java:202)
E/AndroidRuntime( 5572): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1794)
E/AndroidRuntime( 5572): ... 10 more
E/AndroidRuntime( 5572): Caused by: android.os.DeadObjectException
E/AndroidRuntime( 5572): at android.os.BinderProxy.transact(Native Method)
E/AndroidRuntime( 5572): at com.android.mlhome.appwidget.ILauncherAppWidget$Stub$Proxy.getAppWidgetIds(ILauncherAppWidget.java:256)
E/AndroidRuntime( 5572): at com.android.mlhome.appwidget.AppWidgetManager.getAppWidgetIds(AppWidgetManager.java:369)
E/AndroidRuntime( 5572): ... 12 more
Can anybody understand from the above log what exactly is causing this error?
How to fix android.os.DeadObjectException android X
this guy met the same issue, check this link out.
I copyed the answer written by Dimitar Dimitrov as follows
This means that your service had already stopped - either killed from
the OS, or stopped from your application.
Does this problem happen every time you debug your project?
Override your service's onDestroy() method and watch what event flow
leads to it. If you catch DeadObjectException without going through
this method, your service should have been killed by the OS.

Categories

Resources