Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release build crashes but not eh debug build #132

Closed
kmusham opened this issue Oct 16, 2019 · 10 comments
Closed

release build crashes but not eh debug build #132

kmusham opened this issue Oct 16, 2019 · 10 comments

Comments

@kmusham
Copy link

kmusham commented Oct 16, 2019

Your Environment

  • Plugin version: 1.2.4
  • Platform: Android
  • OS version: 10
  • Device manufacturer / model: Google Pixel 3
  • Flutter info (flutter doctor):
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel master, v1.10.15-pre.139, on Microsoft Windows [Version 10.0.18362.418], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.37.0)
[√] Connected device (1 available)

• No issues found!

  • Plugin config:
PASTE_YOUR_CODE_HERE

Expected Behavior

App should not crash

Actual Behavior

App crashes

Steps to Reproduce

  1. create a release build with a license and install on android device.
    2.app crashes

Context

Debug logs

Logs
2019-10-16 11:49:00.786 23102-23102/? I/Adreno: QUALCOMM build                   : bc00834, I609ab310b2
    Build Date                       : 04/11/19
    OpenGL ES Shader Compiler Version: EV031.26.07.00
    Local Branch                     : 
    Remote Branch                    : 
    Remote Branch                    : 
    Reconstruct Branch               : 
2019-10-16 11:49:00.786 23102-23102/? I/Adreno: Build Config                     : S L 8.0.6 AArch64
2019-10-16 11:49:00.790 23102-23102/? I/Adreno: PFP: 0x005ff110, ME: 0x005ff066
2019-10-16 11:49:00.790 13950-13971/? I/MicroDetectionState: Should stop hotword detection immediately - false
2019-10-16 11:49:00.821 637-637/? E/RenderEngine: GL error 0x0501
2019-10-16 11:49:00.853 23102-23102/? D/AndroidRuntime: Shutting down VM
    
    
    --------- beginning of crash
2019-10-16 11:49:00.855 23102-23102/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.compliahealth.mobileedge, PID: 23102
    java.lang.ExceptionInInitializerError
        at com.transistorsoft.locationmanager.b.a.b(Unknown Source:0)
        at c.d.a.a.a.<init>(Unknown Source:36)
        at c.d.a.a.a.a(Unknown Source:2)
        at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(Unknown Source:67)
        at com.compliahealth.mobileedge.MainActivity.onCreate(Unknown Source:3)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        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:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
        at c.d.b.a.a(Unknown Source:27)
        at com.transistorsoft.locationmanager.b.a.<clinit>(Unknown Source:2)
        at com.transistorsoft.locationmanager.b.a.b(Unknown Source:0) 
        at c.d.a.a.a.<init>(Unknown Source:36) 
        at c.d.a.a.a.a(Unknown Source:2) 
        at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(Unknown Source:67) 
        at com.compliahealth.mobileedge.MainActivity.onCreate(Unknown Source:3) 
        at android.app.Activity.performCreate(Activity.java:7802) 
        at android.app.Activity.performCreate(Activity.java:7791) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 
        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:2016) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
2019-10-16 11:49:00.860 1276-3020/? W/ActivityTaskManager:   Force finishing activity com.compliahealth.mobileedge/.MainActivity
Thanks
@christocracy
Copy link
Member

In your android/app/build.gradle, have you minifyEnabled true?

@kmusham
Copy link
Author

kmusham commented Oct 16, 2019

Yes and No.
I tried both cases but did not work. Last buil I tried was with the following configuration.
(see the commented out parameters).

buildTypes {
release {
signingConfig signingConfigs.release
//minifyEnabled true
//shrinkResources true
//useProguard true
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

@christocracy
Copy link
Member

Review the Android Setup and the CHANGELOG.

Clean your build.

@kmusham
Copy link
Author

kmusham commented Oct 16, 2019

Now I followed all the steps and resolved couple of other issues. Now, I see following error . coupled you please help me.

[ +2 ms] [flutter_background_geolocation] Purging debug resources in release build
[ +1 ms] [flutter_background_geolocation] Purging debug resources in release build
[+6978 ms] *********************************************************
[ +5 ms] WARNING: This version of connectivity will break your Android build if it or its dependencies aren't compatible with AndroidX.
[ +3 ms] See https://goo.gl/CP92wY for more information on the problem and how to fix it.
[ +1 ms] This warning prints for all Android build failures. The real root cause of the error may be unrelated.
[ +2 ms] *********************************************************
[ +2 ms] FAILURE: Build failed with an exception.
[ +2 ms] * What went wrong:
[ +1 ms] Could not determine the dependencies of task ':flutter_background_geolocation:compileReleaseAidl'.
[ +2 ms] > Could not resolve all task dependencies for configuration ':flutter_background_geolocation:releaseCompileClasspath'.
[ +5 ms] > Could not find com.google.android.gms:play-services-location:17.3.0.
[ +1 ms] Required by:
[ +2 ms] project :flutter_background_geolocation
[ +2 ms] * Try:
[ +1 ms] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full
insights.
[ +7 ms] * Get more help at https://help.gradle.org
[ +3 ms] BUILD FAILED in 8s

@kmusham
Copy link
Author

kmusham commented Oct 16, 2019

buildscript {
ext.kotlin_version = '1.3.50'
ext {
compileSdkVersion = 29
targetSdkVersion = 29
appCompatVersion = '1.0.2'
playServicesLocationVersion = '17.3.0'
}
repositories {
google()
jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.2'
}

}

@christocracy
Copy link
Member

Where did you get the idea to use playServicesLocationVersion = '17.3.0'? The most recent version is 17.0.0 and the Setup Docs suggest 17.0.0.

See http://maven.google.com: com.google.android.gms.play-services-location:

@kmusham
Copy link
Author

kmusham commented Oct 16, 2019

This is where I found the latest version info
https://developers.google.com/android/guides/releases

Anyway, changing to 17.0.0 solved my issue.
Thank you.

@christocracy
Copy link
Member

That's talking about play-services-auth-api-phone. That has nothing at all to do with play-services-location. Every single Google API has its own distinct version.

@christocracy
Copy link
Member

christocracy commented Oct 16, 2019

The ultimate source for google api versions is http://maven.google.com

@kmusham
Copy link
Author

kmusham commented Oct 16, 2019

Wow! not sure why and how I got that version. Right, I'm supposed to look for 'location' in that page, I just copy pasted the first one without searching..

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants