simple_pdf_viewer crashes on api level 30 [Flutter] - android

App crashes while trying to open pdf in flutter. I have used "simple_pdf_viewer: ^0.2.2".
I have attached the details of the crash report below :
Library link : simple_pdf_viewer .
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 30
java.lang.ExceptionInInitializerError
E/AndroidRuntime( 7294): at okhttp3.internal.platform.Platform.get(Platform.java:85)
E/AndroidRuntime( 7294): at okhttp3.OkHttpClient.newSslSocketFactory(OkHttpClient.java:296)
E/AndroidRuntime( 7294): at okhttp3.OkHttpClient.(OkHttpClient.java:262)
E/AndroidRuntime( 7294): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1054)
E/AndroidRuntime( 7294): at com.liyuanhust.pdfviewer.FileLoader.(FileLoader.kt:155)
E/AndroidRuntime( 7294): at com.liyuanhust.pdfviewer.PdfView.(PdfView.kt:30)
E/AndroidRuntime( 7294): at com.liyuanhust.pdfviewer.PdfViewerFactory.create(PdfViewerFactory.kt:14)
E/AndroidRuntime( 7294): at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:186)
E/AndroidRuntime( 7294): at android.app.Dialog.dispatchOnCreate(Dialog.java:419)
E/AndroidRuntime( 7294): at android.app.Dialog.show(Dialog.java:313)
E/AndroidRuntime( 7294): at android.app.Presentation.show(Presentation.java:257)
E/AndroidRuntime( 7294): at io.flutter.plugin.platform.VirtualDisplayController.(VirtualDisplayController.java:95)
E/AndroidRuntime( 7294): at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48)
E/AndroidRuntime( 7294): at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:207)
E/AndroidRuntime( 7294): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/AndroidRuntime( 7294): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/AndroidRuntime( 7294): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime( 7294): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime( 7294): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:738)
E/AndroidRuntime( 7294): at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime( 7294): at android.os.MessageQueue.next(MessageQueue.java:335)
E/AndroidRuntime( 7294): at android.os.Looper.loop(Looper.java:183)
E/AndroidRuntime( 7294): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime( 7294): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 7294): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime( 7294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/AndroidRuntime( 7294): Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 30
E/AndroidRuntime( 7294): at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:238)
E/AndroidRuntime( 7294): at okhttp3.internal.platform.Platform.findPlatform(Platform.java:202)
E/AndroidRuntime( 7294): at okhttp3.internal.platform.Platform.(Platform.java:79)
E/AndroidRuntime( 7294): ... 26 more

[SOLVED]
I have solved this issue.
Anyone referring to this in future, change the okhttp dependency version to 3.14.7 in the simple_pdf_viewer library present in /flutter/.pub-cache/hosted/pub.dartlang.org/ , it is working fine in android 11 as well.

Related

Uncaught exception in Firebase Database runloop (20.0.6)

I get the following error stack trace when trying to navigate to a screen that uses Firebase Realtime Database for the second time after running the application on my android device.
java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (20.0.6). If you are not already on the latest version of the Firebase SDKs, try updating your dependencies. Should this problem persist, please file a report at https://github.com/firebase/firebase-android-sdk
E/AndroidRuntime( 3934): at com.google.firebase.database.android.AndroidPlatform$1$1.run(AndroidPlatform.java:96)
E/AndroidRuntime( 3934): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime( 3934): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 3934): at android.os.Looper.loopOnce(Looper.java:210)
E/AndroidRuntime( 3934): at android.os.Looper.loop(Looper.java:299)
E/AndroidRuntime( 3934): at android.app.ActivityThread.main(ActivityThread.java:8168)
E/AndroidRuntime( 3934): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3934): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
E/AndroidRuntime( 3934): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037)
E/AndroidRuntime( 3934): Caused by: java.lang.RuntimeException: java.lang.AssertionError: hardAssert failed: listen() called twice for same QuerySpec.
E/AndroidRuntime( 3934): at com.google.firebase.database.core.persistence.NoopPersistenceManager.runInTransaction(NoopPersistenceManager.java:131)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.SyncTree.addEventRegistration(SyncTree.java:549)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.SyncTree.keepSynced(SyncTree.java:857)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.Repo.keepSynced(Repo.java:772)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.Repo.keepSynced(Repo.java:767)
E/AndroidRuntime( 3934): at com.google.firebase.database.Query$4.run(Query.java:267)
E/AndroidRuntime( 3934): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463)
E/AndroidRuntime( 3934): at java.util.concurrent.FutureTask.run(FutureTask.java:264)
E/AndroidRuntime( 3934): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
E/AndroidRuntime( 3934): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
E/AndroidRuntime( 3934): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
E/AndroidRuntime( 3934): at java.lang.Thread.run(Thread.java:1012)
E/AndroidRuntime( 3934): Caused by: java.lang.AssertionError: hardAssert failed: listen() called twice for same QuerySpec.
E/AndroidRuntime( 3934): at com.google.firebase.database.connection.ConnectionUtils.hardAssert(ConnectionUtils.java:67)
E/AndroidRuntime( 3934): at com.google.firebase.database.connection.PersistentConnectionImpl.listen(PersistentConnectionImpl.java:391)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.Repo$5.startListening(Repo.java:206)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.SyncTree.setupListener(SyncTree.java:918)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.SyncTree.access$1000(SyncTree.java:79)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.SyncTree$13.call(SyncTree.java:645)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.SyncTree$13.call(SyncTree.java:550)
E/AndroidRuntime( 3934): at com.google.firebase.database.core.persistence.NoopPersistenceManager.runInTransaction(NoopPersistenceManager.java:126)[1]][1]
My pubspec.yaml file:
My Flutter doctor output:

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.

Chrome cast Notification click not working on less than api level 21

App crashing with
java.lang.RuntimeException: Error receiving broadcast Intent { act=com.espn.score_center/com.framework.chromecast.CastNotificationActivity flg=0x10 bnds=[0,633][1080,971] (has extras) } in afj#439752a8
E/AndroidRuntime( 4624): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:773)
E/AndroidRuntime( 4624): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 4624): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 4624): at android.os.Looper.loop(Looper.java:146)
E/AndroidRuntime( 4624): at android.app.ActivityThread.main(ActivityThread.java:5727)
E/AndroidRuntime( 4624): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4624): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 4624): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
E/AndroidRuntime( 4624): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
E/AndroidRuntime( 4624): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 4624): Caused by: java.lang.SecurityException: Permission Denial: getTasks() from pid=4624, uid=10257 requires android.permission.GET_TASKS
E/AndroidRuntime( 4624): at android.os.Parcel.readException(Parcel.java:1465)
E/AndroidRuntime( 4624): at android.os.Parcel.readException(Parcel.java:1419)
E/AndroidRuntime( 4624): at android.app.ActivityManagerProxy.getTasks(ActivityManagerNative.java:2860)
E/AndroidRuntime( 4624): at android.app.ActivityManager.getRunningTasks(ActivityManager.java:851)
E/AndroidRuntime( 4624): at android.app.ActivityManager.getRunningTasks(ActivityManager.java:887)
E/AndroidRuntime( 4624): at afj.onReceive(:com.google.android.gms.DynamiteModulesC:89)
E/AndroidRuntime( 4624): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:763)

Using Cider on Android

I am trying to follow this tutorial on lein-droid-based Clojure development on Android. However, the tutorial skips on setting up Cider support.
I start with a default lein-droid project by adding
:user {:plugins [ [lein-droid "0.4.0-alpha4"] ]}
to my ~/.lein/profiles.clj, and then run
$ lein droid new android-hello com.example.android_hello
According to the tutorial, I should be able to do a lein droid doall and then connect with Cider to localhost:9999 at this point; however, it is unusable because of nREPL missing on the Android side:
; CIDER 0.9.1 (Java 0, Clojure 1.7.0-beta3-r2, nREPL nil)
WARNING: CIDER's version (0.9.1) does not match cider-nrepl's version (not installed)
So then, according to this other tutorial that I've found, I should add cider-nrepl to my Android dependencies by adding this to ~/.lein/profiles.clj:
:android-user {:plugins [[cider/cider-nrepl "0.9.1"]]
:android {:aot-exclude-ns ["cider.nrepl.middleware.util.java.parser"
"cider.nrepl" "cider-nrepl.plugin"]}}}
So I do a new lein clean; lein droid doall to make sure everything is picked up nicely; and now the resulting program crashes on Android at startup:
W/dalvikvm( 2508): Exception Ljava/lang/IllegalArgumentException; thrown while initializing Ldeps/cljfmt/v0v1v10/cljfmt/core__init;
W/dalvikvm( 2508): Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lcider/nrepl/middleware/format__init;
W/dalvikvm( 2508): threadid=10: thread exiting with uncaught exception (group=0xb5157180)
E/AndroidRuntime( 2508): FATAL EXCEPTION: ClojureLoadingThread
E/AndroidRuntime( 2508): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 2508): at java.lang.Class.classForName(Native Method)
E/AndroidRuntime( 2508): at java.lang.Class.forName(Class.java:217)
E/AndroidRuntime( 2508): at clojure.lang.RT.classForName(RT.java:2201)
E/AndroidRuntime( 2508): at clojure.lang.RT.classForName(RT.java:2210)
E/AndroidRuntime( 2508): at clojure.lang.RT.loadClassForName(RT.java:2229)
E/AndroidRuntime( 2508): at clojure.lang.RT.load(RT.java:461)
E/AndroidRuntime( 2508): at clojure.lang.RT.load(RT.java:437)
E/AndroidRuntime( 2508): at clojure.core$load$fn__5442.invoke(core.clj:5858)
E/AndroidRuntime( 2508): at clojure.core$load.doInvoke(core.clj:5857)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.invoke(RestFn.java:408)
E/AndroidRuntime( 2508): at clojure.core$load_one.invoke(core.clj:5663)
E/AndroidRuntime( 2508): at clojure.core$load_lib$fn__5391.invoke(core.clj:5703)
E/AndroidRuntime( 2508): at clojure.core$load_lib.doInvoke(core.clj:5702)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.applyTo(RestFn.java:142)
E/AndroidRuntime( 2508): at clojure.core$apply.invoke(core.clj:630)
E/AndroidRuntime( 2508): at clojure.core$load_libs.doInvoke(core.clj:5741)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.applyTo(RestFn.java:137)
E/AndroidRuntime( 2508): at clojure.core$apply.invoke(core.clj:630)
E/AndroidRuntime( 2508): at clojure.core$require.doInvoke(core.clj:5824)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.invoke(RestFn.java:408)
E/AndroidRuntime( 2508): at neko.tools.repl$start_repl$fn__6556$fn__6557.invoke(repl.clj:77)
E/AndroidRuntime( 2508): at clojure.core$map$fn__4547.invoke(core.clj:2616)
E/AndroidRuntime( 2508): at clojure.lang.LazySeq.sval(LazySeq.java:40)
E/AndroidRuntime( 2508): at clojure.lang.LazySeq.seq(LazySeq.java:49)
E/AndroidRuntime( 2508): at clojure.lang.RT.seq(RT.java:534)
E/AndroidRuntime( 2508): at clojure.core$seq__4122.invoke(core.clj:135)
E/AndroidRuntime( 2508): at clojure.core$apply.invoke(core.clj:628)
E/AndroidRuntime( 2508): at neko.tools.repl$start_repl$fn__6556.invoke(repl.clj:75)
E/AndroidRuntime( 2508): at clojure.core$with_redefs_fn.invoke(core.clj:7185)
E/AndroidRuntime( 2508): at neko.tools.repl$start_repl.doInvoke(repl.clj:72)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.applyTo(RestFn.java:139)
E/AndroidRuntime( 2508): at clojure.core$apply.invoke(core.clj:630)
E/AndroidRuntime( 2508): at neko.tools.repl$init.doInvoke(repl.clj:102)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.invoke(RestFn.java:397)
E/AndroidRuntime( 2508): at clojure.lang.Var.invoke(Var.java:375)
E/AndroidRuntime( 2508): at neko.App.loadClojure(App.java:40)
E/AndroidRuntime( 2508): at neko.App$1.run(App.java:51)
E/AndroidRuntime( 2508): at java.lang.Thread.run(Thread.java:856)
E/AndroidRuntime( 2508): Caused by: java.lang.ExceptionInInitializerError
E/AndroidRuntime( 2508): at java.lang.Class.classForName(Native Method)
E/AndroidRuntime( 2508): at java.lang.Class.forName(Class.java:217)
E/AndroidRuntime( 2508): at clojure.lang.RT.classForName(RT.java:2201)
E/AndroidRuntime( 2508): at clojure.lang.RT.classForName(RT.java:2210)
E/AndroidRuntime( 2508): at clojure.lang.RT.loadClassForName(RT.java:2229)
E/AndroidRuntime( 2508): at clojure.lang.RT.load(RT.java:461)
E/AndroidRuntime( 2508): at clojure.lang.RT.load(RT.java:437)
E/AndroidRuntime( 2508): at clojure.core$load$fn__5442.invoke(core.clj:5858)
E/AndroidRuntime( 2508): at clojure.core$load.doInvoke(core.clj:5857)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.invoke(RestFn.java:408)
E/AndroidRuntime( 2508): at clojure.core$load_one.invoke(core.clj:5663)
E/AndroidRuntime( 2508): at clojure.core$load_lib$fn__5391.invoke(core.clj:5703)
E/AndroidRuntime( 2508): at clojure.core$load_lib.doInvoke(core.clj:5702)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.applyTo(RestFn.java:142)
E/AndroidRuntime( 2508): at clojure.core$apply.invoke(core.clj:630)
E/AndroidRuntime( 2508): at clojure.core$load_libs.doInvoke(core.clj:5741)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.applyTo(RestFn.java:137)
E/AndroidRuntime( 2508): at clojure.core$apply.invoke(core.clj:630)
E/AndroidRuntime( 2508): at clojure.core$require.doInvoke(core.clj:5824)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.invoke(RestFn.java:703)
E/AndroidRuntime( 2508): at cider.nrepl.middleware.format$loading__5334__auto____6889.invoke(format.clj:1)
E/AndroidRuntime( 2508): at cider.nrepl.middleware.format__init.load(Unknown Source)
E/AndroidRuntime( 2508): at cider.nrepl.middleware.format__init.<clinit>(Unknown Source)
E/AndroidRuntime( 2508): ... 38 more
E/AndroidRuntime( 2508): Caused by: java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil
E/AndroidRuntime( 2508): at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:554)
E/AndroidRuntime( 2508): at clojure.java.io$fn__8970$G__8946__8977.invoke(io.clj:69)
E/AndroidRuntime( 2508): at clojure.java.io$reader.doInvoke(io.clj:102)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.invoke(RestFn.java:410)
E/AndroidRuntime( 2508): at clojure.lang.AFn.applyToHelper(AFn.java:154)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.applyTo(RestFn.java:132)
E/AndroidRuntime( 2508): at clojure.core$apply.invoke(core.clj:630)
E/AndroidRuntime( 2508): at clojure.core$slurp.doInvoke(core.clj:6645)
E/AndroidRuntime( 2508): at clojure.lang.RestFn.invoke(RestFn.java:410)
E/AndroidRuntime( 2508): at clojure.core$comp$fn__4489.invoke(core.clj:2432)
E/AndroidRuntime( 2508): at clojure.core$comp$fn__4489.invoke(core.clj:2432)
E/AndroidRuntime( 2508): at deps.cljfmt.v0v1v10.cljfmt.core__init.load(Unknown Source)
E/AndroidRuntime( 2508): at deps.cljfmt.v0v1v10.cljfmt.core__init.<clinit>(Unknown Source)
E/AndroidRuntime( 2508): ... 61 more
W/ActivityManager( 867): Force finishing activity hu.erdi.gergo.clojure_android_hello.debug/hu.erdi.gergo.clojure_android_hello.SplashActivity
W/WindowManager( 867): Failure taking screenshot for (180x300) to layer 21010
D/dalvikvm( 867): GC_CONCURRENT freed 561K, 13% free 11324K/12871K, paused 0ms+2ms
W/NetworkManagementSocketTagger( 867): setKernelCountSet(10041, 0) failed with errno -2
Seems you made a small mistake when following the tutorial you referenced above.
This:
:android-user {:plugins [[cider/cider-nrepl "0.9.1"]]
:android {:aot-exclude-ns ["cider.nrepl.middleware.util.java.parser"
"cider.nrepl" "cider-nrepl.plugin"]}}}
Should be:
:android-user {:dependencies [[cider/cider-nrepl "0.9.1"]]
:android {:aot-exclude-ns ["cider.nrepl.middleware.util.java.parser"
"cider.nrepl" "cider-nrepl.plugin"]}}

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...

Categories

Resources