KDC
KDC

Reputation: 611

Flutter build apk crashes on startup even if all package names are the same

Is there any way to isolate this problem? Every time I tried to install my build apk on any device, it keeps crashing but on debug mode it works fine. I don't get any error when running flutter build apk aside from after installing it and opening it immediately crashes. Also the app is not yet signed just wanna test it on different mobiles using a generated apk

What I tried so far:

  1. Change all package names to same in AndroidManifest.xml in app/src and the folders with xmls there.
  2. Change package names to the one I've used in AndroidManifest in build.gradle
  3. Even changed the package name in google-services.json since I'm using Firebase

In case it is needed heres my pubspec.yaml

name: vmembershipofficial
description: V Membership App

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^0.4.3+1
  cupertino_icons: ^0.1.2
  firebase_analytics: ^5.0.9
  firebase_auth: ^0.15.3+1
  cloud_firestore: ^0.13.0+1
  firebase_database: ^3.1.1
  firebase_storage: ^3.1.1
  image_picker: ^0.6.3
  font_awesome_flutter: ^8.5.0
  flutter_bloc: ^3.1.0
  bloc_pattern: ^2.3.2
  video_player: ^0.10.5+1

dev_dependencies:
  flutter_test:
    sdk: flutter


# The following section is specific to Flutter.
flutter:

  assets:
   - assets/images/

  fonts:
    # - family: Schyler
    #   fonts:
    #     - asset: fonts/Schyler-Regular.ttf
    #     - asset: fonts/Schyler-Italic.ttf
    #       style: italic
    - family: Lato
      fonts:
        - asset: assets/fonts/Lato-Black.ttf
        - asset: assets/fonts/Lato-Blackitalic.ttf
        - asset: assets/fonts/Lato-Bold.ttf
        - asset: assets/fonts/Lato-Bolditalic.ttf
        - asset: assets/fonts/Lato-italic.ttf
        - asset: assets/fonts/Lato-Light.ttf
        - asset: assets/fonts/Lato-Lightitalic.ttf
        - asset: assets/fonts/Lato-Regular.ttf
        - asset: assets/fonts/Lato-Thin.ttf
        - asset: assets/fonts/Lato-Thinitalic.ttf

Upvotes: 3

Views: 951

Answers (1)

KDC
KDC

Reputation: 611

I fixed it. Out of nowhere I think of using flutter pub upgrade and it works. I saw a similar question here in Stack but it doesn't work for me I will just comment my answer on that question to help others as well.

Upvotes: 2

Related Questions