asynctask errors after android studio update - java

app have no error but asyntask.java has errors, abouth annotations, what can i do?
import android.annotation.MainThread;
import android.annotation.Nullable;
import android.annotation.WorkerThread;
import android.compat.annotation.UnsupportedAppUsage;
Cannot resolve symbol 'MainThread'
android.annotation.Nullable' is not public in 'android.annotation'.
Cannot be accessed from outside package
Cannot resolve symbol 'WorkerThread'
Cannot resolve symbol 'annotation'
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.faysoft.shbmtal, PID: 8632
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$4.done(AsyncTask.java:415)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: org.w3c.dom.DOMException: Only one root element allowed
at org.apache.harmony.xml.dom.DocumentImpl.insertChildAt(DocumentImpl.java:420)
at org.apache.harmony.xml.dom.InnerNodeImpl.appendChild(InnerNodeImpl.java:52)
at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:307)
at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:128)

Cause by line is pointing on some parsing exception, your data source changed, not Android Studio

Related

java.lang.UnsatisfiedLinkError: No implementation found for void com.netdatasoft.android.divvydrive.scanner.views.CameraView.decode

I had an image scanning activity with openCV infrastructure before. However, even though there is no code change at the moment, it gives an error and restarts the application. It gives a warning to a method in Asynctask.
java.lang.UnsatisfiedLinkError: No implementation found for void com.netdatasoft.android.divvydrive.scanner.views.CameraView.decode(byte[], int, int, int[])
2022-08-07 19:34:48.610 10271-10357/com.netdatasoft.android.divvydrive E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.netdatasoft.android.divvydrive, PID: 10271
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$AsyncFutureTask.done(AsyncTask.java:429)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void com.netdatasoft.android.divvydrive.scanner.views.CameraView.decode(byte[], int, int, int[]) (tried Java_com_netdatasoft_android_divvydrive_scanner_views_CameraView_decode and Java_com_netdatasoft_android_divvydrive_scanner_views_CameraView_decode___3BII_3I)
at com.netdatasoft.android.divvydrive.scanner.views.CameraView.decode(Native Method)
at com.netdatasoft.android.divvydrive.scanner.views.CameraView.access$200(CameraView.java:35)
at com.netdatasoft.android.divvydrive.scanner.views.CameraView$PreviewFrameAsyncTask.doInBackground(CameraView.java:274)
at com.netdatasoft.android.divvydrive.scanner.views.CameraView$PreviewFrameAsyncTask.doInBackground(CameraView.java:262)
at android.os.AsyncTask$3.call(AsyncTask.java:389)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:292) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:929) 

UnsatisfiedLinkError when trying to create new instance of TessBaseAPI

This is a weird error because it doesn't happen every time - mostly rare - so it's difficult to debug.
This is the line where the error occurs:
TessBaseAPI tessBaseApi = new TessBaseAPI();
I use this library to connect Tesseract with Android.
The error log:
E/linker: package com.app.myapp: library "/system/lib64/libjpeg.so"
("/system/lib64/libjpeg.so") needed or dlopened by
"/system/lib64/libnativeloader.so" is not accessible for the
namespace: [name="classloader-namespace", ld_library_paths="",
default_library_paths="/data/app/com.app.myapp-4EcKvX8ZmvEUrqVJAF20Dg==/lib/arm64:/data/app/com.app.myapp-4EcKvX8ZmvEUrqVJAF20Dg==/base.apk!/lib/arm64-v8a",
permitted_paths="/data:/mnt/expand:/mnt/asec:/data/data/com.app.myapp"]
D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION:
main
Process: com.app.myapp, PID: 6393
java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib64/libjpeg.so" needed or dlopened by
"/system/lib64/libnativeloader.so" is not accessible for the namespace
"classloader-namespace"
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1657)
at com.googlecode.tesseract.android.TessBaseAPI.(TessBaseAPI.java:52)
at com.app.myapp.utils.UtilsOCR.getTessBaseAPI(UtilsOCR.java:257)
at com.app.myapp.ocr.OCRTextEvaluator.init(OCRTextEvaluator.java:381)
at com.app.myapp.ocr.OCRTextEvaluator.(OCRTextEvaluator.java:48)
at com.app.myapp.helper.NotebookWriter.init(NotebookWriter.java:530)
at com.app.myapp.helper.NotebookWriter.(NotebookWriter.java:89)
Inside TessBaseAPI class the error occurs in this line:
System.loadLibrary("jpeg");
Any kind of help would be appreciated.

App Crash but there is no error in the code

I have list of items in the RecyclerView and if I click the item then it should display corresponding items. If I click the item then the app is crashing with the below message. Its not showing any error in the code. Is it a library issue? or JSON Issue? I am new to Android Development. Any help is highly appreciated.
io.reactivex.exceptions.OnErrorNotImplementedException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3 path $
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated(ObservableObserveOn.java:276)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:172)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3 path $
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1559)
at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1401)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:593)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:74)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:37)
at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:25)
at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:119)
at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:218)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:41)
at io.reactivex.Observable.subscribe(Observable.java:10981)
at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34)
at io.reactivex.Observable.subscribe(Observable.java:10981)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Just now I found the issue. Its due syntax error in my SQL statement where I missed e in the where condition so, its not able to fetch data. After syntax error fix then I am able to pull data without any issues. Thanks everyone for your help.

java.lang.VerifyError when downloading data with jsoup in Android N

I compiled my Android app for the new Android N version and then tried to test it on an emulator. It runs normally until I try to download and parse some website data using the "jsoup" library. Then I get this java.lang.VerifyError:
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.masrepus.vplanapp, PID: 6584
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:318)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.VerifyError: Verifier rejected class org.jsoup.parser.HtmlTreeBuilderState$7: boolean org.jsoup.parser.HtmlTreeBuilderState$7.process(org.jsoup.parser.Token, org.jsoup.parser.HtmlTreeBuilder) failed to verify: boolean org.jsoup.parser.HtmlTreeBuilderState$7.process(org.jsoup.parser.Token, org.jsoup.parser.HtmlTreeBuilder): [0x140B] Invalid reg type for array index (Reference: org.jsoup.nodes.Node[]) (declaration of 'org.jsoup.parser.HtmlTreeBuilderState$7' appears in /data/app/com.masrepus.vplanapp-2/base.apk)
at org.jsoup.parser.HtmlTreeBuilderState.<clinit>(HtmlTreeBuilderState.java:246)
at org.jsoup.parser.HtmlTreeBuilder.parse(HtmlTreeBuilder.java:53)
at org.jsoup.parser.Parser.parseInput(Parser.java:30)
at org.jsoup.helper.DataUtil.parseByteData(DataUtil.java:81)
at org.jsoup.helper.HttpConnection$Response.parse(HttpConnection.java:517)
at org.jsoup.helper.HttpConnection.post(HttpConnection.java:174)
at com.masrepus.vplanapp.network.AsyncDownloader.updateAvailableFilesList(AsyncDownloader.java:961)
at com.masrepus.vplanapp.network.AsyncDownloader.downloadVplan(AsyncDownloader.java:237)
at com.masrepus.vplanapp.network.AsyncDownloader.doInBackground(AsyncDownloader.java:135)
at com.masrepus.vplanapp.network.AsyncDownloader.doInBackground(AsyncDownloader.java:113)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
at java.lang.Thread.run(Thread.java:761) 
While researching on VerifyErrors, I came across some solutions, like cleaning the project build folder. But those solutions didn't help.
What I am wondering is, what [0x140B] Invalid reg type for array index means. This may be the thing I have to resolve, but I don't know how.
Edit:
So I dove a bit deeper into the problem and located the crash inside the block named "InBody" in org.jsoup.parser.HtmlTreeBuilderState, lines 244-759. I don't know why, but when I set breakpoints there, the program never stops there, so I have no clue at which exact position inside this block the crash happens. But as the error message speaks of some sort of array index, I figured it might be one of the 6 for-loops I found that have something to do with the data type "Element": They are at lines 305, 388, 561, 582, 602 and 640
Disable jack.
I got the same error when I enable jack. I disabled jack and compiled, no error. Then I copied jsoup source code to my project folder, enabled jack and compiled, no error. So I think it is a bug of jill, the tool to convert *.class to *.jack.

No Class Def Found Error Android-Bolts Parse

I am using Android Studio (latest version) for developing my app. I use Parse as a backend solution. Everything was working smooth until i found out that parse have new release and i wanted to upgrade from Parse-1.7.1.jar to Parse-1.8.3.jar (latest version).
Since parse now use Bolts lib i also added the library like this:
compile 'com.parse.bolts:bolts-android:1.1.4'
Parse.initialize();
Also i use the facebook-sdk for dont know if this have to do anything with this mess.
All i get in my Application onCreate method is this error
03-08 22:07:05.841 24519-24533/ant.flow E/dalvikvm﹕ Could not find class 'bolts.Task$TaskCompletionSource', referenced from method com.parse.ParsePinningEventuallyQueue.waitForOperationSetAndEventuallyPin
03-08 22:07:05.841 24519-24519/ant.flow E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: ant.flow, PID: 24519
java.lang.NoClassDefFoundError: bolts.BoltsExecutors
at bolts.Task.<clinit>(Task.java:31)
at com.parse.ParseSQLiteDatabase.<init>(ParseSQLiteDatabase.java:45)
at com.parse.ParseSQLiteDatabase.openDatabaseAsync(ParseSQLiteDatabase.java:33)
at com.parse.ParseSQLiteOpenHelper.getDatabaseAsync(ParseSQLiteOpenHelper.java:43)
at com.parse.ParseSQLiteOpenHelper.getWritableDatabaseAsync(ParseSQLiteOpenHelper.java:39)
at com.parse.OfflineStore.findAsync(OfflineStore.java:390)
at com.parse.OfflineStore.findAsync(OfflineStore.java:354)
at com.parse.ParsePin.getParsePin(ParsePin.java:22)
at com.parse.ParseQuery.countFromLocalDatastoreAsync(ParseQuery.java:885)
at com.parse.ParseQuery.access$1700(ParseQuery.java:78)
at com.parse.ParseQuery$22.call(ParseQuery.java:1132)
at com.parse.ParseQuery$22.call(ParseQuery.java:1128)
at com.parse.ParseQuery.doWithRunningCheck(ParseQuery.java:912)
at com.parse.ParseQuery.countInBackground(ParseQuery.java:1128)
at com.parse.ParseInstallation.hasCurrentInstallationAsync(ParseInstallation.java:88)
at com.parse.GcmRegistrar.updateAsync(GcmRegistrar.java:96)
at com.parse.Parse.initialize(Parse.java:240)
at ant.flow.SocialApplication.onCreate(SocialApplication.java:33)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1025)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4581)
at android.app.ActivityThread.access$1600(ActivityThread.java:161)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1325)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)

Categories

Resources