我的应用程序自行关闭而没有错误

时间:2017-02-06 14:59:16

标签: android

我的问题是我的应用程序在返回到我的片段后关闭,我没有错误。我用调试器一步一步地完成了整个步骤,我在代码中找不到任何不会导致问题的内容,我到达最后一个括号,然后应用程序关闭。我找了几天,但我找不到。这是我的应用程序关闭时的logcat。

D/AndroidRuntime: Shutting down VM
I/art: System.exit called, status: 2
I/AndroidRuntime: VM exiting with result code 2, cleanup skipped.
D/ContextRelationManager: ContextRelationManager() : FEATURE_ENABLED=true
D/RelationGraph: garbageCollect()
W/ResourcesManager: getTopLevelResources: /data/app/com.Me.MyApp-1/base.apk / 1.0 running in com.Me.MyApp rsrc of package com.Me.MyApp
I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
D/ResourcesManager: For user 0 new overlays fetched Null
I/InjectionManager: Inside getClassLibPath caller 
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
D/TimaKeyStoreProvider: TimaSignature is unavailable
D/ActivityThread: Added TimaKeyStore provider
D/ContextRelationManager: ContextRelationManager() : FEATURE_ENABLED=true
D/RelationGraph: garbageCollect()
W/ResourcesManager: getTopLevelResources: /data/app/com.Me.MyApp-1/base.apk / 1.0 running in com.Me.MyApp rsrc of package com.Me.MyApp
I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
D/ResourcesManager: For user 0 new overlays fetched Null
I/InjectionManager: Inside getClassLibPath caller 
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_2_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_4_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_5_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.Me.MyApp-1/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.Me.MyApp-1@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
W/System: ClassLoader referenced unknown path: /data/app/com.Me.MyApp-1/lib/arm64
D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-1/base.apk / 1.0 running in com.Me.MyApp rsrc of package com.google.android.gms
D/ResourcesManager: For user 0 new overlays fetched Null
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:4
I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 4
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000011/n/arm64-v8a
W/ResourcesManager: getTopLevelResources: /data/user/0/com.google.android.gms/app_chimera/m/00000011/DynamiteModulesC_GmsCore_prodmnc_alldpi_release.apk / 1.0 running in com.Me.MyApp rsrc of package com.Me.MyApp
D/ResourcesManager: For user 0 new overlays fetched Null
W/ResourcesManager: getTopLevelResources: /data/user/0/com.google.android.gms/app_chimera/m/00000011/DynamiteModulesC_GmsCore_prodmnc_alldpi_release.apk / 1.0 running in com.Me.MyApp rsrc of package com.Me.MyApp
I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader p[DexPathList[[zip file "/data/data/com.google.android.gms/app_chimera/m/00000011/DynamiteModulesC_GmsCore_prodmnc_alldpi_release.apk"],nativeLibraryDirectories=[/data/user/0/com.google.android.gms/app_chimera/m/00000011/n/arm64-v8a, /vendor/lib64, /system/lib64]]]
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
I/FA: App measurement is starting up, version: 10084
I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
D/FA: Debug-level message logging enabled
D/FA: AppMeasurement singleton hash: 144190966
W/ResourcesManager: getTopLevelResources: /data/app/com.Me.MyApp-1/base.apk / 1.0 running in com.Me.MyApp rsrc of package com.Me.MyApp
V/FA: Collection enabled
V/FA: App package, google app id: com.Me.MyApp, 1:*********:android:*********
I/FA: To enable faster debug mode event logging run:
        adb shell setprop debug.firebase.analytics.app com.Me.MyApp
V/FA: Registered activity lifecycle callback
I/FirebaseCrash: FirebaseCrash reporting initialized com.google.android.gms.internal.zzbks@910b5f7
I/FirebaseInitProvider: FirebaseApp initialization successful
V/FA: Using measurement service
D/InjectionManager: InjectionManager
D/InjectionManager: fillFeatureStoreMap com.Me.MyApp
I/InjectionManager: Constructor com.Me.MyApp, Feature store :{}
I/InjectionManager: featureStore :{}
V/FA: Connecting to remote service
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 1
V/FA: Inactivity, disconnecting from the service®

有人可以告诉我这个关闭的原因吗?

编辑:我的班级执行onResume

后发生错误
/**
 * A simple {@link Fragment} subclass.
 * Activities that contain this fragment must implement the
 * {@link FragmentScore.OnFragmentInteractionListener} interface
 * to handle interaction events.
 * Use the {@link FragmentScore#newInstance} factory method to
 * create an instance of this fragment.
 */
public class FragmentScore extends Fragment {
    public static final int RES_NOUVELLE_DONNE_OK = 42;
    //indentifiant de la requête faite à l'activité AddRound
    private static final int REQUEST_RESULTAT_DONNE = 1;
    // TODO: Rename parameter arguments, choose names that match
    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";
    private static ArrayList<int[]> scores;
    //BackupAgents
    private BackupManager backupManager;
    private int last_id_round;
    private TableLayout table;
    private TextView[] textTotal;
    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    // MENU AVEC LES TROIS PETITS POINTS
    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    private int nbLignes = 0;
    private EditText editTextj1;
    private EditText editTextj2;
    private EditText editTextj3;
    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    // MENU AVEC LES TROIS PETITS POINTS : AJOUT MANUEL
    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    private EditText editTextj4;
    private EditText editTextj5;
    private int joueur_null = 0;
    private int j1 = 0;
    private int j2 = 0;
    // custom dialog
    private int j3 = 0;
    private int j4 = 0;
    private int j5 = 0;
    private String j1_string = "";
    private String j2_string = "";
    private String j3_string = "";
    private String j4_string = "";
    private String j5_string = "";
    private boolean champs_vide = false;
    private boolean j1_vide = false;
    private boolean j2_vide = false;
    private boolean j3_vide = false;
    private boolean j4_vide = false;
    private boolean j5_vide = false;
    private String error = "";

    private OnFragmentInteractionListener mListener;

    public FragmentScore() {
        // Required empty public constructor
    }

    /**
     * Use this factory method to create a new instance of
     * this fragment using the provided parameters.
     *
     * @param param1 Parameter 1.
     * @param param2 Parameter 2.
     * @return A new instance of fragment FragmentScore.
     */
    // TODO: Rename and change types and number of parameters
    public static FragmentScore newInstance(String param1, String param2) {
        FragmentScore fragment = new FragmentScore();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }




    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            @SuppressWarnings("UnusedAssignment") String mParam1 = getArguments().getString(ARG_PARAM1);
            @SuppressWarnings("UnusedAssignment") String mParam2 = getArguments().getString(ARG_PARAM2);
        }
        setHasOptionsMenu(true);
        //Récuperation des parametre de l'écran et les appliques
        Screen.initialise(getActivity());
        backupManager = new BackupManager(getContext());
        last_id_round = 0;
    }

    @Override
    public void onResume() {
        super.onResume();
        loadGame(Data.id_game);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View rootView = inflater.inflate(R.layout.fragment_score, container, false);
        FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab);

        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), nouvelle_donne.class);
                startActivity(intent);
            }
        });


        //initialisation de la liste des scores
        scores = new ArrayList<>();


        TableRow.LayoutParams llp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
        llp.setMargins(4, 4, 4, 2);//2px right-margin

        table = (TableLayout) rootView.findViewById(R.id.tableau);

        TableRow row = new TableRow(getContext());
        row.setLayoutParams(llp);
        for (int i = 0; i < Data.nb_joueur; i++) {
            TextView Tv = new TextView(getContext());
            Tv.setId(i + 10);
            Tv.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.grey_500));
            switch (i) {
                case 0:
                    Tv.setText(Data.bdd.get_joueur_by_id(Data.joueur_1).getNom());
                    break;
                case 1:
                    Tv.setText(Data.bdd.get_joueur_by_id(Data.joueur_2).getNom());
                    break;
                case 2:
                    Tv.setText(Data.bdd.get_joueur_by_id(Data.joueur_3).getNom());
                    break;
                case 3:
                    Tv.setText(Data.bdd.get_joueur_by_id(Data.joueur_4).getNom());
                    break;
                case 4:
                    Tv.setText(Data.bdd.get_joueur_by_id(Data.joueur_5).getNom());
                    break;
            }
            Tv.setLayoutParams(llp);

            row.addView(Tv);
        }
        row.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.border, null));


        //initialisation du total des Scores
        TableRow.LayoutParams llp2 = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
        // TableRow row2 = new TableRow(this);

        //  row2.setLayoutParams(llp2);
        if (!isTablet(getContext()))
            llp2.setMargins(2, 2, 2, 20);
        else
            llp2.setMargins(2, 2, 2, 10);
        textTotal = new TextView[Data.nb_joueur];


        TableRow rowTot = new TableRow(getContext());
        rowTot.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.border, null));

        rowTot.setLayoutParams(llp);
        for (int i = 0; i < Data.nb_joueur; i++) {
            TextView tv = new TextView(getContext());
            tv.setId(i + 10);
            tv.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.border, null));
            tv.setText("0");
            tv.setLayoutParams(llp2);
            textTotal[i] = tv;
            rowTot.addView(tv);
        }

        table.addView(row);
        table.addView(rowTot);

        return rootView;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (context instanceof OnFragmentInteractionListener) {
            mListener = (OnFragmentInteractionListener) context;
        } else {
            throw new RuntimeException(context.toString()
                    + " must implement OnFragmentInteractionListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mListener = null;
    }


    private void updateTot() {
        for (int i = 0; i < Data.nb_joueur; ++i) {
            int som = 0;
            for (int j = 0; j < scores.size(); ++j) {
                som += scores.get(j)[i];
            }
            textTotal[i].setText("" + som);
            if (som > 0) {
                textTotal[i].setBackgroundColor(ContextCompat.getColor(getContext(), R.color.green_500));
            } else if (som < 0) {
                textTotal[i].setBackgroundColor(ContextCompat.getColor(getContext(), R.color.red_700));
            } else {
                textTotal[i].setBackgroundColor(ContextCompat.getColor(getContext(), R.color.green_400));
            }
        }
    }

    private void addLigne(int[] score, int id_round) {
        Log.d("DEBUG", "Ligne ajoutée");
        TableRow.LayoutParams llp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
        if (!isTablet(getContext()))
            llp.setMargins(4, 4, 4, 4);
        else
            llp.setMargins(1, 1, 1, 1);

        TableRow row = new TableRow(getContext());
        row.setLayoutParams(llp);
        row.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.border, null));
        int color;

        for (int i = 0; i < Data.nb_joueur; i++) {
            if (score[i] < 0) {
                color = ContextCompat.getColor(getContext(), R.color.red_300);

            } else {
                color = ContextCompat.getColor(getContext(), R.color.green_300);
            }

            TextView tv = new TextView(getContext());
            tv.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.border, null));
            tv.setId(i + 10);
            tv.setBackgroundColor(color);
            tv.setText("" + score[i]);
            tv.setLayoutParams(llp);


            row.addView(tv);
        }
        table.addView(row);
        ++nbLignes;
        updateTot();
        last_id_round = Data.id_round;
    }

    private void addScore(int id_game, int id_round) {
        int nb_player = Data.bdd.get_nb_joueur(id_game);
        int player[] = Data.bdd.get_player_in_game(id_game);
        if (player == null) { //on vient de créé la partie
            return;
        }
        int i = 0;
        int[] score = new int[nb_player];
        while (i < nb_player) {
            score[i] = Score.read_score_for_player(id_game, id_round, player[i], i + 1);
            i++;
        }
        scores.add(score);
        addLigne(score, id_round);

    }

    private void loadGame(int id_game) {
        FirebaseCrash.log("Chargement de la partie : " + id_game + " (id_game)");
        Log.d("LOADGAME","Chargement de la partie n°"+id_game);
        List<Integer> list = Data.bdd.loadGame(id_game);
        for (int id_round : list)
            addScore(id_game, id_round);

    }

    private boolean isTablet(Context context) {
        boolean xlarge = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE);
        boolean large = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
        return (xlarge || large);
    }

    /**
     * This interface must be implemented by activities that contain this
     * fragment to allow an interaction in this fragment to be communicated
     * to the activity and potentially other fragments contained in that
     * activity.
     * <p>
     * See the Android Training lesson <a href=
     * "http://developer.android.com/training/basics/fragments/communicating.html"
     * >Communicating with Other Fragments</a> for more information.
     */
    public interface OnFragmentInteractionListener {
        // TODO: Update argument type and name
        void onFragmentInteraction(Uri uri);
    }
}

1 个答案:

答案 0 :(得分:0)

我发现了我的问题,这来自firebase我在调试模式下禁用:我添加了这个以禁用它但这是这个bug的问题

Bind