Search code examples
androidcrashgoogle-play-consolegoogle-developers-console

the release .aab version of the application crashes


The release .aab version of the application immediately crashes when its downloaded from the play store, but when its installed with Android Studio or apk everything is fine

I tried to find solutions but there are no right solutions anywhere

Сan you tell me how to fix it, please

there is Stack trace from google play console

java.lang.RuntimeException: 
   at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3334)
   at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3473)
   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:2067)
   at android.os.Handler.dispatchMessage (Handler.java:107)
   at android.os.Looper.loop (Looper.java:224)
   at android.app.ActivityThread.main (ActivityThread.java:7519)
   at java.lang.reflect.Method.invoke (Native Method)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:539)
   at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:995)

I have only one activity:

class ValidationActivity : AppCompatActivity(){

private lateinit var navController: NavController
private lateinit var appBarConfiguration: AppBarConfiguration
lateinit var pref: CookiePreferences

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_validation)

    pref = CookiePreferences.getInstance(this)!!

    val navHostFragment =
        supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
    navController = navHostFragment.findNavController()

    appBarConfiguration = AppBarConfiguration(
        setOf( 
            R.id.loginFragment,
            R.id.eventsFragment
        )
    )

    navController.addOnDestinationChangedListener { _, destination, _ ->
        if(destination.id == R.id.loginFragment) {    
            toolbar.visible(false) 
        } else {
            toolbar.visible(true)
        }

    }

    setSupportActionBar(toolbar)
    setupActionBarWithNavController(navController, appBarConfiguration)
}

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
    menuInflater.inflate(R.menu.valid_app_bar_menu, menu)
    val item: MenuItem = menu?.findItem(R.id.app_bar_logout)!!
    navController.addOnDestinationChangedListener { _, destination, _ ->
        if(destination.id == R.id.eventsFragment) {   
            item.isVisible = true
        } else {
            item.isVisible = true
        }
    }

    return true
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
    return if (item.itemId == R.id.app_bar_logout) {
        pref.deleteCookiesPrefs()
        navController.navigate(R.id.action_global_loginFragment)
        true
    } else {
        item.onNavDestinationSelected(navController) || super.onOptionsItemSelected(item)
    }
}

override fun onSupportNavigateUp(): Boolean {
    return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
}

}

full stack from adb logcat:

259 17259 D AndroidRuntime: Shutting down VM
05-30 17:44:38.394 17259 17259 E AndroidRuntime: FATAL EXCEPTION: main
05-30 17:44:38.394 17259 17259 E AndroidRuntime: Process: com.ticketonpartners.ticketonscanners, PID: 17259
05-30 17:44:38.394 17259 17259 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ticketonpartners.ticketonscanners/com.ticketonpartners.ticketonscanner.ui.validations.ValidationActivity}: android.view.InflateException: Binary XML file line #30 in com.ticketonpartners.ticketonscanners:layout/activity_validation: Binary XML file line #30 in com.ticketonpartners.ticketonscanners:layout/activity_validation: Error inflating class fragment
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3700)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3879)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2315)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:260)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8265)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)
05-30 17:44:38.394 17259 17259 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #30 in com.ticketonpartners.ticketonscanners:layout/activity_validation: Binary XML file line #30 in com.ticketonpartners.ticketonscanners:layout/activity_validation: Error inflating class fragment
05-30 17:44:38.394 17259 17259 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #30 in com.ticketonpartners.ticketonscanners:layout/activity_validation: Error inflating class fragment
05-30 17:44:38.394 17259 17259 E AndroidRuntime: Caused by: java.lang.RuntimeException: Exception inflating com.ticketonpartners.ticketonscanners:navigation/valid_nav line 33
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at androidx.navigation.p.c(Unknown Source:119)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at androidx.navigation.NavController.j(:2)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at androidx.navigation.fragment.NavHostFragment.I(:26)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at androidx.fragment.app.h0.e(:1)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at androidx.fragment.app.h0.k(:8)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at androidx.fragment.app.z.onCreateView(:10)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at androidx.fragment.app.q.onCreateView(:4)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1067)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:995)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at e.l.v(Unknown Source:23)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at e.i.setContentView(Unknown Source:7)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at com.ticketonpartners.ticketonscanner.ui.validations.ValidationActivity.onCreate(Unknown Source:16)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:8146)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:8130)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3669)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3879)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2315)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:260)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8265)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
05-30 17:44:38.394 17259 17259 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)
05-30 17:44:38.394 17259 17259 E AndroidRuntime: Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.ticketonpartners.ticketonscanner.data.models.Events
05-30 17:44:38.394 17259 17259 E A

navigation/valid_nav, live 39 is on app:argType="com.ticketonpartners.ticketonscanner.data.models.Show"

    <fragment
    android:id="@+id/validationContainerFragment"
    android:name="com.ticketonpartners.ticketonscanner.ui.validations.validation.ValidationContainerFragment"
    android:label="@string/validation"
    tools:layout="@layout/fragment_validation_container" >
    <argument
        android:name="show"
        app:argType="com.ticketonpartners.ticketonscanner.data.models.Show" />
</fragment>

Show class:

import java.io.Serializable

data class Show(
   val name: String,
   val ts: String,
   val uid: String
) : Serializable

Solution

  • If you look at the cause of the stacktrace, it says:

    ClassNotFoundException: com.ticketonpartners.ticketonscanner.data.models.Events
    

    I suspect you use this class in your definition of your view navigation/valid_nav but this class is obfuscated by your proguard configuration.

    You may need to tweak your proguard keep rules to not remove or rename this class.