NlptechProduct / Android-Keyboard

Android Keyboard with 180+ dictionaries. Support swipe input (sliding input), Emoji keyboard, AI predictions, dictionaries downloading, and keyboard themes.
Apache License 2.0
200 stars 75 forks source link

App Crashed when no internet . #175

Open SardarKhan299 opened 4 years ago

SardarKhan299 commented 4 years ago

When try to launch the app when there is no internet. app crashed here is the logcat messages. Kindly fix this . thanks

03-20 21:00:37.906 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.net.UnknownHostException: Unable to resolve host "api.nlpte.ch": No address associated with hostname 03-20 21:00:37.906 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated(ObservableObserveOn.java:281) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:172) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154) 03-20 21:00:37.916 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.lang.Thread.run(Thread.java:818) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: Caused by: java.net.UnknownHostException: Unable to resolve host "api.nlpte.ch": No address associated with hostname 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.net.InetAddress.lookupHostByName(InetAddress.java:440) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at java.net.InetAddress.getAllByName(InetAddress.java:215) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.Dns$Companion$SYSTEM$1.lookup(Dns.kt:48) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.kt:160) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.kt:125) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.connection.RouteSelector.next(RouteSelector.kt:71) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:199) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:109) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:77) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.connection.Transmitter.newExchange$okhttp(Transmitter.kt:162) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:35) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at com.nlptech.language.internal.RequestInterceptor.intercept() 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at okhttp3.RealCall.execute(RealCall.kt:66) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:45) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.Observable.subscribe(Observable.java:12267) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.Observable.subscribe(Observable.java:12267) 03-20 21:00:37.926 11509-11576/com.fasturduengemojikeyboard.easyurdu W/System.err: at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)

SardarKhan299 commented 4 years ago

@AoShenFengYu @willypwu @NlptechProduct @kote6363 any update on this issue? kindly fix this asap. thanks

SardarKhan299 commented 4 years ago

Hi, Can anyone tell me what the issue is and can you fix this issue? @AoShenFengYu @willypwu @kote6363 @NlptechProduct

NlptechProduct commented 4 years ago

Hi, you can add setRxJavaErrorHandler(); in the onCreate method of your Application class. Just like what we do in TestApplicaion.java in this project.

SardarKhan299 commented 4 years ago

Hi, @NlptechProduct thanks for the reply. I am really waiting for your reply. yes I have already added this code in my onCreate method. private void setRxJavaErrorHandler() { RxJavaPlugins.setErrorHandler(throwable -> { if (throwable instanceof UnknownHostException) { // ignore BleExceptions as they were surely delivered at least once } }); } but still got the error.

SardarKhan299 commented 4 years ago

@NlptechProduct i think you don't add error handle method in rxjava.

NlptechProduct commented 4 years ago

@SardarKhan299 We have fixed it. Please upgrade to the latest version. Thanks.

SardarKhan299 commented 4 years ago

@NlptechProduct ok thanks i will check it.

SardarKhan299 commented 4 years ago

@NlptechProduct after upgrade to latest version some compilation error occurred . kindly check this. AAPT: error: 'stickyOff' is incompatible with attribute backgroundType (attr) enum [empty=0, functional=2, normal=1, spacebar=6] [weak].

SardarKhan299 commented 4 years ago

@NlptechProduct check the path. main\res\xml-sw600dp\key_styles_common.xml:59: AAPT: error: 'stickyOn' is incompatible with attribute backgroundType (attr) enum [empty=0, functional=2, normal=1, spacebar=6] [weak].

SardarKhan299 commented 4 years ago

@NlptechProduct also this app\src\main\res\xml-sw600dp\key_styles_enter.xml:85: AAPT: error: 'action' is incompatible with attribute backgroundType (attr) enum [empty=0, functional=2, normal=1, spacebar=6] [weak].

NlptechProduct commented 4 years ago

@NlptechProduct after upgrade to latest version some compilation error occurred . kindly check this. AAPT: error: 'stickyOff' is incompatible with attribute backgroundType (attr) enum [empty=0, functional=2, normal=1, spacebar=6] [weak].

@SardarKhan299 Is it happening on this demo project? I can build it successfully.

SardarKhan299 commented 4 years ago

@NlptechProduct yes. you can run the app and then check it,

SardarKhan299 commented 4 years ago

@NlptechProduct yes this project builds successfully but when trying to run it shows this error. kindly check it.

NlptechProduct commented 4 years ago

@SardarKhan299 I ran it on my device successfully. It didn't happen on my phone.

SardarKhan299 commented 4 years ago

@NlptechProduct i am using implementation 'com.nlptech.zengine:keyboardkernel:1.3.12'

NlptechProduct commented 4 years ago

@SardarKhan299 So do I. It works fine. Is it happening on this demo project or on your own project?

SardarKhan299 commented 4 years ago

@NlptechProduct it was my own project i am using your keyboard as library in my project's gradle file.

NlptechProduct commented 4 years ago

@SardarKhan299 Do you have this in your build.gradle file? lintOptions { abortOnError false }

SardarKhan299 commented 4 years ago

Yes my gradle file is lintOptions { abortOnError false } sourceSets { main { assets.srcDirs = ['src/main/assets'] // jniLibs.srcDirs = ['src/main/jniLibs'] } } //For language test dataBinding { enabled = true }

compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
}

There Error occurred here.

<key-style latin:styleName="shiftKeyStyle" latin:keySpec="!icon/shift_key_shifted|!code/key_shift" latin:backgroundType="stickyOff" latin:parentStyle="baseForShiftKeyStyle" />

it says, This .

AAPT: error: 'stickyOff' is incompatible with attribute backgroundType (attr) enum [empty=0, functional=2, normal=1, spacebar=6] [weak].

SardarKhan299 commented 4 years ago

@NlptechProduct did you check this issue?