Solution 1 :
Intent i = new Intent(this, nextActivity.class);
change this to
Intent i = new Intent(MainActivity.this, NextActivity.class);
Also do not forget to add your activities to Manifest.
Are these both classes extends AppCompatActivity or etc?*
Solution 2 :
Unfortunately, there is not much information in your question that could help to find the error. Have you declared the Activity (“NextActivity”) in your AndroidManifest.xml?
<activity
android_name=".NextActivity"/>
Problem :
As soon as I addIntent i = new Intent(this, nextActivity.class);
to my code, my app doesn’t open anymore and crashes instantly. I tried debugging it on the Emulator and on my phone.
Logcat:
02-27 12:03:51.124 1637-1646/com.android.systemui I/art: Debugger is no longer active
02-27 12:03:51.124 1667-1675/android.process.media I/art: Debugger is no longer active
02-27 12:03:51.124 2302-2309/com.android.providers.calendar I/art: Debugger is no longer active
02-27 12:03:51.126 1945-1957/com.google.android.gms.persistent I/art: Debugger is no longer active
02-27 12:03:51.145 2339-2339/com.android.deskclock V/AlarmClock: AlarmInitReceiver android.intent.action.TIME_SET
02-27 12:03:51.173 2500-2508/com.android.settings I/art: Debugger is no longer active
02-27 12:03:51.173 1637-1646/com.android.systemui W/art: Suspending all threads took: 49.014ms
02-27 12:03:51.220 2150-3150/com.google.android.gms I/SystemUpdate: [Installation,ReceiverIntentOperation] Received intent: Intent { act=android.intent.action.TIME_SET flg=0x24000010 cmp=com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver }.
02-27 12:03:51.237 2150-3150/com.google.android.gms W/ChimeraUtils: Non Chimera context
02-27 12:03:51.237 2150-3150/com.google.android.gms W/ChimeraUtils: Non Chimera context
02-27 12:03:51.303 2150-3151/com.google.android.gms I/SystemUpdate: [Execution,InstallationEventIntentOperation] Handling event of type 6.
02-27 12:03:51.398 2150-3150/com.google.android.gms I/SystemUpdate: [Execution,InstallationIntentOperation] Received intent: Intent { act=com.google.android.gms.update.INSTALL_UPDATE cat=[targeted_intent_op_prefix:.update.execution.InstallationIntentOperation] cmp=com.google.android.gms/.chimera.GmsIntentOperationService }.
02-27 12:03:51.399 2150-3150/com.google.android.gms I/SystemUpdate: [Execution,ExecutionManager] Action finished-execution executed for 0.00 seconds.
02-27 12:03:51.448 2339-2361/com.android.deskclock V/AlarmClock: AlarmInitReceiver finished
02-27 12:03:54.296 3165-3165/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
02-27 12:03:54.297 3165-3165/? D/AndroidRuntime: CheckJNI is ON
02-27 12:03:54.335 3165-3165/? E/memtrack: Couldn't load memtrack module (No such file or directory)
02-27 12:03:54.335 3165-3165/? E/android.os.Debug: failed to load memtrack module: -2
02-27 12:03:54.353 3165-3165/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
02-27 12:03:54.369 3165-3165/? I/art: System.exit called, status: 0
02-27 12:03:54.369 3165-3165/? I/AndroidRuntime: VM exiting with result code 0.
02-27 12:03:54.472 3175-3175/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
02-27 12:03:54.473 3175-3175/? D/AndroidRuntime: CheckJNI is ON
02-27 12:03:54.513 3175-3175/? E/memtrack: Couldn't load memtrack module (No such file or directory)
02-27 12:03:54.513 3175-3175/? E/android.os.Debug: failed to load memtrack module: -2
02-27 12:03:54.530 3175-3175/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
02-27 12:03:54.551 1139-1139/? I/installd: free_cache(1423720) avail 285745152
02-27 12:03:54.592 3175-3175/? I/art: System.exit called, status: 0
02-27 12:03:54.592 3175-3175/? I/AndroidRuntime: VM exiting with result code 0.
02-27 12:03:54.682 3187-3187/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
02-27 12:03:54.683 3187-3187/? D/AndroidRuntime: CheckJNI is ON
02-27 12:03:54.716 3187-3187/? E/memtrack: Couldn't load memtrack module (No such file or directory)
02-27 12:03:54.716 3187-3187/? E/android.os.Debug: failed to load memtrack module: -2
02-27 12:03:54.735 3187-3187/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
02-27 12:03:54.758 1527-1565/system_process E/PackageInstaller: Commit of session 912649873 failed: Package /data/app/vmdl912649873.tmp/0_app-debug has no certificates at entry AndroidManifest.xml
02-27 12:03:54.760 3187-3187/? E/Pm: Failure details: Bundle[{android.content.pm.extra.STATUS=4, android.content.pm.extra.SESSION_ID=912649873, android.content.pm.extra.LEGACY_STATUS=-103, android.content.pm.extra.STATUS_MESSAGE=INSTALL_PARSE_FAILED_NO_CERTIFICATES: Package /data/app/vmdl912649873.tmp/0_app-debug has no certificates at entry AndroidManifest.xml}]
02-27 12:03:54.762 3187-3187/? I/art: System.exit called, status: 1
02-27 12:03:54.762 3187-3187/? I/AndroidRuntime: VM exiting with result code 1.
02-27 12:04:00.431 1527-1802/system_process D/AlarmManagerService: Kernel timezone updated to -60 minutes west of GMT
02-27 12:04:00.433 1527-1855/system_process D/AlarmManagerService: Setting time of day to sec=1582801441
02-27 12:04:01.020 2339-2339/com.android.deskclock V/AlarmClock: AlarmInitReceiver android.intent.action.TIME_SET
02-27 12:04:01.091 2339-2361/com.android.deskclock V/AlarmClock: AlarmInitReceiver finished
02-27 12:04:01.158 2150-3204/com.google.android.gms I/SystemUpdate: [Installation,ReceiverIntentOperation] Received intent: Intent { act=android.intent.action.TIME_SET flg=0x24000010 cmp=com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver }.
02-27 12:04:01.218 2150-3203/com.google.android.gms I/SystemUpdate: [Execution,InstallationEventIntentOperation] Handling event of type 6.
02-27 12:04:01.220 2150-3205/com.google.android.gms I/SystemUpdate: [Execution,InstallationIntentOperation] Received intent: Intent { act=com.google.android.gms.update.INSTALL_UPDATE cat=[targeted_intent_op_prefix:.update.execution.InstallationIntentOperation] cmp=com.google.android.gms/.chimera.GmsIntentOperationService }.
02-27 12:04:01.316 2150-3205/com.google.android.gms I/SystemUpdate: [Execution,ExecutionManager] Action finished-execution executed for 0.00 seconds.
There hasn’t been a solution in the internet that helped me with this problem. It only crashes when I use the Intent with this code. Using Intent in any other kind of way doesn’t make the app crash.
Comments
Comment posted by Lena Bru
this log does not contain a crash log
Comment posted by Ankit Tale
Please add log after system crash. There you will see message as The beginning of crash in logcat
Comment posted by Neeraj
Just pointing out,
Comment posted by Zealous System
Share your code
Comment posted by Kanwarpreet Singh
Add logs after the crash and where are you passing Intent, instead of this give Activity reference.