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

Null pointer exception crash #224

Closed
longlinht opened this issue Apr 19, 2021 · 18 comments
Closed

Null pointer exception crash #224

longlinht opened this issue Apr 19, 2021 · 18 comments
Assignees

Comments

@longlinht
Copy link

Basic environment info:

  • System version 6.0.1

  • Java version 8

  • Gradle version 6.6.1

  • Android Gradle plugin version 4.0.0

  • Booster version 3.1.0

  • Stack traces

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'java.lang.String java.io.File.getParent()' on a null object reference
com.didiglobal.booster.instrument.sharedpreferences.SharedPreferencesManager.<init> (SharedPreferencesManager.java:36)
com.didiglobal.booster.instrument.sharedpreferences.BoosterSharedPreferences.<init> (BoosterSharedPreferences.java:42)
com.didiglobal.booster.instrument.sharedpreferences.BoosterSharedPreferences.getSharedPreferences (BoosterSharedPreferences.java:58)
com.didiglobal.booster.instrument.ShadowSharedPreferences.getSharedPreferences (ShadowSharedPreferences.java:15)
com.google.android.gms.internal.ads.zzabb.initialize (zzabb.java:33)
com.google.android.gms.internal.ads.zzabf.zzi (zzabf.java:15)
com.google.android.gms.internal.ads.zzabe.get (zzabe.java)
com.google.android.gms.ads.internal.util.zzbu.zza (zzbu.java:13)
com.google.android.gms.internal.ads.zzabf.initialize (zzabf.java:1)
com.google.android.gms.internal.ads.zzanc.run (zzanc.java:2)
java.lang.Thread.run (Thread.java:818)

Gradle dependencies :

dependencies {
            classpath "com.didiglobal.booster:booster-gradle-plugin:$booster_version"
            classpath "com.didiglobal.booster:booster-transform-shared-preferences:$booster_version"
            classpath "com.didiglobal.booster:booster-transform-thread:$booster_version"
            classpath "com.didiglobal.booster:booster-transform-activity-thread:$booster_version"
            classpath "com.didiglobal.booster:booster-transform-finalizer-watchdog-daemon:$booster_version"
        }

After using booster, received many this type of crash in firebase console. Please make me know whether I use booster improperly or this is bug.

@johnsonlee
Copy link
Collaborator

It seems a bug of booster-transform-shared-preferences @neighbWang

@johnsonlee
Copy link
Collaborator

We are going to refactor booster-transform-shared-preferences

@johnsonlee
Copy link
Collaborator

Could you help to check the device model ? It might be occurred on emulator.

@longlinht
Copy link
Author

Could you help to check the device model ? It might be occurred on emulator.

Hi, crash occurred in these device models: Galaxy J2 Prime, Galaxy Grand Neo, Galaxy J3(2016), MAXTRON U22, while crashed occurred in most of Galaxy J2 Prime(76%).

johnsonlee added a commit to johnsonlee/booster that referenced this issue May 10, 2021
johnsonlee added a commit to johnsonlee/booster that referenced this issue May 10, 2021
johnsonlee added a commit to johnsonlee/booster that referenced this issue May 10, 2021
@johnsonlee
Copy link
Collaborator

Please try v3.3.1-rc1

johnsonlee added a commit to johnsonlee/booster that referenced this issue May 10, 2021
@johnsonlee johnsonlee mentioned this issue May 10, 2021
@longlinht
Copy link
Author

Please try v3.3.1-rc1

Wow! thanks, I will try it!

@longlinht
Copy link
Author

Please try v3.3.1-rc1

v3.3.1-rc is released? gradle could not find it!

@johnsonlee
Copy link
Collaborator

Please try v3.3.1-rc1

v3.3.1-rc is released? gradle could not find it!

v3.3.1-rc1 the tailing 1 missed

@johnsonlee
Copy link
Collaborator

implementation 'com.didiglobal.booster:booster-gradle-plugin:3.3.1-rc1'

@johnsonlee
Copy link
Collaborator

@longlinht
Copy link
Author

implementation 'com.didiglobal.booster:booster-gradle-plugin:3.3.1-rc1'

Please try v3.3.1-rc1

v3.3.1-rc is released? gradle could not find it!

v3.3.1-rc1 the tailing 1 missed

Please try v3.3.1-rc1

v3.3.1-rc is released? gradle could not find it!

v3.3.1-rc1 the tailing 1 missed

implementation 'com.didiglobal.booster:booster-gradle-plugin:3.3.1-rc1'

I changed it to 3.3.1-rc1, but gradle still can not find it, should I add a new maven repository? thank you!

@johnsonlee
Copy link
Collaborator

mavenCentral() is enough

@longlinht
Copy link
Author

mavenCentral() is enough

So strange, mavenCentral already in my repository list!

@longlinht
Copy link
Author

mavenCentral() is enough

* What went wrong:
A problem occurred configuring root project 'zuiyou_overseas'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.didiglobal.booster:booster-gradle-plugin:3.3.1-rc1.
     Required by:
         project :
      > No matching variant of com.didiglobal.booster:booster-gradle-plugin:3.3.1-rc1 was found. The consumer was configured to find a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally but:                                                                
          - Variant 'apiElements' capability com.didiglobal.booster:booster-gradle-plugin:3.3.1-rc1 declares a component, packaged as a jar, and its dependencies declared externally:                                                                                                                    
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8                                                                                                                                  
          - Variant 'runtimeElements' capability com.didiglobal.booster:booster-gradle-plugin:3.3.1-rc1 declares a runtime of a component, packaged as a jar, and its dependencies declared externally:                                                                                           
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
   > Could not resolve com.didiglobal.booster:booster-transform-shared-preferences:3.3.1-rc1.
     Required by:
         project :
      > No matching variant of com.didiglobal.booster:booster-transform-shared-preferences:3.3.1-rc1 was found. The consumer was configured to find a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally but:                                                                
          - Variant 'apiElements' capability com.didiglobal.booster:booster-transform-shared-preferences:3.3.1-rc1 declares a component, packaged as a jar, and its dependencies declared externally:                                                                                                        
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8                                                                                                                                  
          - Variant 'runtimeElements' capability com.didiglobal.booster:booster-transform-shared-preferences:3.3.1-rc1 declares a runtime of a component, packaged as a jar, and its dependencies declared externally:                                                                                           
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
   > Could not resolve com.didiglobal.booster:booster-transform-thread:3.3.1-rc1.
     Required by:
         project :
      > No matching variant of com.didiglobal.booster:booster-transform-thread:3.3.1-rc1 was found. The consumer was configured to find a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally but:                                                                
          - Variant 'apiElements' capability com.didiglobal.booster:booster-transform-thread:3.3.1-rc1 declares a component, packaged as a jar, and its dependencies declared externally:                                                                                                        
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8                                                                                                                                  
          - Variant 'runtimeElements' capability com.didiglobal.booster:booster-transform-thread:3.3.1-rc1 declares a runtime of a component, packaged as a jar, and its dependencies declared externally:                                                                                           
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8

* Try:
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.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 800ms

@johnsonlee
Copy link
Collaborator

It might be caused by the new CI env, v3.3.1-rc1 was built by Java 11, I'll fix it later

@longlinht
Copy link
Author

It might be caused by the new CI env, v3.3.1-rc1 was built by Java 11, I'll fix it later

OK, thanks!

@johnsonlee
Copy link
Collaborator

3.3.1-rc3 is available, but not synced to mavenCentral so far, you can add sonatype maven repo to access it

@johnsonlee
Copy link
Collaborator

3.3.1 released

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

3 participants