java – App crashes instantly after successful build / Android Studio-ThrowExceptions

Exception or error:
02-23 00:59:12.043 20430-20430/? I/art: Late-enabling -Xcheck:jni
02-23 00:59:12.313 20430-20430/? W/System: ClassLoader referenced unknown path: /data/app/com.example.zarabiajonline-2/lib/arm64
02-23 00:59:12.608 20430-20430/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
02-23 00:59:12.749 20430-20430/? I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
02-23 00:59:12.749 20430-20430/? I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
02-23 00:59:13.511 20430-20430/? I/Process: Sending signal. PID: 20430 SIG: 9

After successfully building the application, it starts and then turns off immediately. No errors are displayed except for the above. There are also no errors in the code. Can u tell me what is going on? I can add more code if u need it (other files)

U can check this: https://imgur.com/a/mrMpSqg
MainActivity:

package com.example.zarabiajonline;

import android.os.Bundle;
import android.view.MenuItem;

import com.google.android.material.bottomnavigation.BottomNavigationView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;

public class MainActivity extends AppCompatActivity {



    private BottomNavigationView.OnNavigationItemSelectedListener         mOnNavigationItemSelectedListener
            = new BottomNavigationView.OnNavigationItemSelectedListener()     {

        @Override
        public boolean onNavigationItemSelected(MenuItem item) {
            Fragment fragment=null;
            switch (item.getItemId()) {
                case R.id.navigation_promocje:
                    fragment = new Promocje();
                    break;

                case R.id.navigation_airdropy:
                    fragment = new Airdropy();
                    break;

                case R.id.navigation_nagrody:
                    fragment = new Nagrody();
                    break;


            }
            return LoadFragment(fragment);
        }
    };

    private boolean LoadFragment(Fragment fragment) {
        if (fragment != null) {
            getSupportFragmentManager()
                    .beginTransaction()
                    .replace(R.id.fragment_container, fragment)
                    .commit();
            return true;
        }
        return false;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        LoadFragment(new Promocje());
        BottomNavigationView navigation = (BottomNavigationView)     findViewById(R.id.navigation);
        navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
    }

}
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *