Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception #933

Open
AcidRain9 opened this issue Jul 29, 2020 · 0 comments
Open

Fatal Exception #933

AcidRain9 opened this issue Jul 29, 2020 · 0 comments

Comments

@AcidRain9
Copy link

This is my simple code

import androidx.appcompat.app.AppCompatActivity;

import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;

import com.google.gson.JsonObject;
import com.koushikdutta.async.future.FutureCallback;
import com.koushikdutta.ion.Ion;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Network network = new Network();
    network.execute();
}







public class Network extends AsyncTask<String,Void,String>{

    @Override
    protected String doInBackground(String... strings) {
        try {

            Ion.with(getApplicationContext()).load("http://example.com/thing.json").asJsonObject().setCallback(new FutureCallback<JsonObject>() {
                @Override
                public void onCompleted(Exception e, JsonObject result) {
                    Log.i("json", result.toString());
                }
            });


        } catch (Exception e) {
            e.printStackTrace();

        }
        return null;
    }
}

This is the error I'm getting

2020-07-29 06:42:15.878 7801-7827/com.example.weatherapp E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.example.weatherapp, PID: 7801
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: java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.art/javalib/core-oj.jar)
at com.koushikdutta.async.future.SimpleFuture.setCallback(SimpleFuture.java:216)
at com.koushikdutta.ion.IonRequestBuilder.resolveAndLoadRequest(IonRequestBuilder.java:390)
at com.koushikdutta.ion.IonRequestBuilder.getLoaderEmitter(IonRequestBuilder.java:354)
at com.koushikdutta.ion.IonRequestBuilder.getLoaderEmitter(IonRequestBuilder.java:317)
at com.koushikdutta.ion.IonRequestBuilder.execute(IonRequestBuilder.java:690)
at com.koushikdutta.ion.IonRequestBuilder.execute(IonRequestBuilder.java:643)
at com.koushikdutta.ion.IonRequestBuilder.asJsonObject(IonRequestBuilder.java:696)
at com.example.weatherapp.MainActivity$Network.doInBackground(MainActivity.java:46)
at com.example.weatherapp.MainActivity$Network.doInBackground(MainActivity.java:40)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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) 

Can anyone please explain what am I doing wrong I tried to debug it many times but I was unsuccessful

Any help will be appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant