• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android: Rejecting Invocation

  • Thread starter Thread starter Ishankg
  • Start date Start date
I

Ishankg

Guest
I have built an app for android which takes the data and enters it in a google sheet. The form has like 600+ values and was working flawlessly but it has broken upon adding more fields and now I am being greeted with these in logs when it crashes:


Code:
2020-02-05 21:22:07.139 13879-13879/? E/ngpatternsurve: Unknown bits set in runtime_flags: 0x8000
2020-02-05 21:22:15.218 13879-13879/com.example.farmingpatternsurvey E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.farmingpatternsurvey, PID: 13879
    java.lang.VerifyError: Verifier rejected class com.example.farmingpatternsurvey.AddItem: void com.example.farmingpatternsurvey.AddItem.addItemToSheet() failed to verify: void com.example.farmingpatternsurvey.AddItem.addItemToSheet(): [0x1901] Rejecting invocation, expected 70 argument registers, method signature has 71 or more (declaration of 'com.example.farmingpatternsurvey.AddItem' appears in /data/app/com.example.farmingpatternsurvey-QW7Re8Z-Ysdw_hc1wHuYTA==/base.apk)
        at java.lang.Class.newInstance(Native Method)
        at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
        at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:41)
        at android.app.Instrumentation.newActivity(Instrumentation.java:1243)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3182)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

App crashes when I try to start this 'AddItem' activity from my 'MainActivity' activity using this simple code:


Code:
@Override
    public void onClick(View v) {

        if(v==buttonAddItem){

            Intent intent = new Intent(getApplicationContext(),AddItem.class);
            startActivity(intent);
        }

    }

Here is the method addItemToSheet() from AddItem activity:

Java:
private void   addItemToSheet() {
final ProgressDialog loading = ProgressDialog.show(this,"Adding Item","Please wait");
        final String farmer_name = editfarmer_name.getText().toString().trim();
        final String husband_father = edithusband_father.getText().toString().trim();
        final String village = editvillage.getText().toString().trim();
        . 
        .
        .
        .
        .(more 'fetching strings from editText and storing in variable')

StringRequest stringRequest = new StringRequest(Request.Method.POST, "https://script.google.com/macros/s/xyxyyxyxyxyx/exec",
                new Response.Listener<String>() {
                    @Override
                    public void onResponse(String response) {

                        loading.dismiss();
                        Toast.makeText(AddItem.this,response,Toast.LENGTH_LONG).show();
                        Intent intent = new Intent(getApplicationContext(),MainActivity.class);
                        startActivity(intent);
                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        loading.dismiss();
                        Toast.makeText(AddItem.this,"Error, Please try again, no internet or weak internet",Toast.LENGTH_LONG).show();
                    }
                }
        ) {

            @Override
            protected Map<String, String> getParams() {
                Map<String, String> params = new HashMap<>();

                //here we pass params
                params.put("action","addItem");
                params.put("farmer_name",farmer_name);
                params.put("husband_father",husband_father);
                params.put("village",village);
                .
                .
                .
                .
                . (more params)

}


Please let me know what am I doing wrong. Tried googling but it has not helped.

Thank you for your time.
 
Back
Top Bottom