Android: App runs on emulator but it crashes on my mobile phone

后端 未结 2 1102
轻奢々
轻奢々 2021-01-28 08:37

My app works on the emulator Nexus 5(Android 7.0, API 24) but it crashes on my mobile phone(Samsung J5 Android 5.1.1) in a precise activity when I try to open another activity w

2条回答
  •  伪装坚强ぢ
    2021-01-28 08:48

    Update your Android SDK to the version of your android cellphone and in build.gradle file define the minimum and max sdk versions for your mobile.

    android {
     ...
    defaultConfig {
    ...
    minSdkVersion 14
    targetSdkVersion 24
    }
    productFlavors {
      main {
      ...
     }
     afterLollipop {
       ...
      minSdkVersion 21
    }
    }
    }
    

提交回复
热议问题