ClassLoader 在转到下一个时引用了未知路径 activity

ClassLoader referenced unknown path when going to next activity

我目前有 4 个不同的按钮。其中 3 个导致相同的 activity,但用不同的数据填充 ArrayList。不同数据集之间的唯一区别是大小。

每次我使用工作按钮 selectCountryAndStateButton 一切正常。但是,当我使用 getAllFacilitiesButton 应用程序 returns 到以前的 activity 时,我在 LogCat

中得到以下内容
02-08 11:56:26.649 22325-22325/? W/System: ClassLoader referenced unknown path: /data/app/com.company.app-1/lib/x86
02-08 11:56:26.668 22325-22325/? I/GMPM: App measurement is starting up, version: 8487
02-08 11:56:26.668 22325-22325/? I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
02-08 11:56:26.791 22325-22336/com.company.app I/art: Background partial concurrent mark sweep GC freed 418(17KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 4MB/7MB, paused 9.593ms total 21.620ms
02-08 11:56:27.097 22325-22359/com.company.app D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
02-08 11:56:27.177 22325-22359/com.company.app I/OpenGLRenderer: Initialized EGL, version 1.4
02-08 11:56:27.187 22325-22359/com.company.app W/EGL_emulation: eglSurfaceAttrib not implemented
02-08 11:56:27.187 22325-22359/com.company.app W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xad7e0960, error=EGL_SUCCESS

在错误发生之前,我收到了以下信息。

02-08 11:38:41.064 14907-14907/? E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services.  Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.

但是我通过将 google_app_id.xml 添加到我的资源来更正错误。

当完全相同的代码处理一组小得多的数据时,为什么我会遇到 class 加载程序未知引用问题?

编辑:2/8/2016 1:25pm [中央]

发现我的消息被过滤了。我收到以下错误:

E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 526172)

这意味着我的 644 个对象列表太大而无法传递给下一个 activity。将回答解决方案

-----下面是我的代码-----

工作按钮 (facilities.size() < 100 )

selectCountryAndStateButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            ServiceConnector sc = getServiceConnector();
            sc.execute(APICallEnum.SEARCH_BY_COUNTRY, countrySelected, stateSelected);

            try {
                String data = sc.get();
                List<Facility> facilities = JSONParser.getFromJson(data);
                //Open list activity of facilities
                openListActivity(facilities);

            } catch (ExecutionException e) {
                e.printStackTrace();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }


        }
    });

按钮不起作用 (facilities.size() = 644)

getAllFacilitiesButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Log.i("Search", "get all");

            ServiceConnector sc = getServiceConnector();
            sc.execute(APICallEnum.GET_ALL_FACILITIES);

            try {
                String data = sc.get();
                List<Facility> facilities = JSONParser.getFromJson(data);
                openListActivity(facilities);
            } catch (ExecutionException e) {
                e.printStackTrace();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    });

打开下一个Activity代码

private void openListActivity(List<Factility> f) {
    Intent intent = new Intent(FindLocation.this, ListingActivity.class);
    intent.putExtra("facilities", new FacilityList(f));

    startActivity(intent);
}

此问题是由于试图通过 Intent 传递大量设施引起的。

我通过执行获取新 activity 中的数据来解决这个问题,而不是传递获取所需的信息。