Android: App crashes every time I try to create a new folder

Created on 4 Nov 2019  路  9Comments  路  Source: nextcloud/android

*** CAUSE OF ERROR ***

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.owncloud.android.datamodel.OCFile.getRemotePath()' on a null object reference
at com.owncloud.android.ui.dialog.CreateFolderDialogFragment.onClick(CreateFolderDialogFragment.java:139)
at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6986)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)

*** APP INFORMATION ***
ID: com.nextcloud.client
Version: 30090051
Build flavor: gplay

*** DEVICE INFORMATION ***
Brand: samsung
Device: star2qlteue
Model: SM-G965U1
Id: PPR1.180610.011
Product: star2qlteue

*** FIRMWARE ***
SDK: 28
Release: 9
Incremental: G965U1UEU7CSJ3

approved bug high pr exists

Most helpful comment

@AndyScherzinger @tobiasKaminsky
Good morning,
This bug happens only in the "root" because mFile is empty in FileActivity when we're in the root (/) folder.
I'm working on a fix

All 9 comments

I also have this problem in this function
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.owncloud.android.datamodel.OCFile.getRemotePath()' on a null object reference
at
com.owncloud.android.utils.FileStorageUtils.checkEncryption.nStatus(FileStorageUtils.java440)...

@tobiasKaminsky seems to happen on several occasions.

Happened today with while setting up instant upload folder, with the same stacktrace as in the description:

************ APP INFORMATION ************
ID: com.nextcloud.client
Version: 30090290
Build flavor: generic

************ DEVICE INFORMATION ************
Brand: acer
Device: acer_T02
Model: T02
Id: LMY47D
Product: T02_ww

************ FIRMWARE ************
SDK: 22
Release: 5.1
Incremental: 1464248381

I originally posted this as part of #5081 by error (my own, sorry)

I'll go back and collect more specific details to add.

Reproduced easily for me... on two diff devices.

  1. Select _Auto upload_
  2. Select _Set up a custom folder_
  3. Select _Remote folder_
  4. Select _New folder_
  5. Enter any name press _Create_

BOOM


~~~
*** CAUSE OF ERROR ***

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.owncloud.android.datamodel.OCFile.getRemotePath()' on a null object reference
at com.owncloud.android.ui.dialog.CreateFolderDialogFragment.onClick(CreateFolderDialogFragment.java:139)
at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

*** APP INFORMATION ***
ID: com.nextcloud.client
Version: 30090290
Build flavor: gplay

*** DEVICE INFORMATION ***
Brand: google
Device: manta
Model: Nexus 10
Id: LMY49J
Product: mantaray

*** FIRMWARE ***
SDK: 22
Release: 5.1.1
Incremental: 2640980
~~~


~~~
*** CAUSE OF ERROR ***

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.owncloud.android.datamodel.OCFile.getRemotePath()' on a null object reference
at com.owncloud.android.ui.dialog.CreateFolderDialogFragment.onClick(CreateFolderDialogFragment.java:139)
at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7073)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

*** APP INFORMATION ***
ID: com.nextcloud.client
Version: 30090290
Build flavor: generic

*** DEVICE INFORMATION ***
Brand: samsung
Device: dream2qltesq
Model: SM-G955U
Id: PPR1.180610.011
Product: dream2qltesq

*** FIRMWARE ***
SDK: 28
Release: 9
Incremental: G955USQU7DSL3

~~~

A more careful trial...

Create folder from android tablet at top level
Works fine

Scenario #1:

  1. Choose "Auto upload"
  2. Picked 'screenshots'
  3. Enabled preferences for autouploading
  4. Choose "Remote Folder"
    Presented with top level view.
  5. Choose "New Folder"
  6. Enter anything and select "Create"

Boom

Senario #2:

  1. Choose "Auto upload"
  2. Picked 'screenshots'
  3. Enabled preferences for autouploading
  4. Choose "Remote Folder"
    Presented with top level view.
  5. Choose existing sub folder
  6. Choose "New Folder"
  7. Enter anything and select "Create"

Works

cc @tobiasKaminsky since reports are pilling up

@AndyScherzinger @tobiasKaminsky
Good morning,
This bug happens only in the "root" because mFile is empty in FileActivity when we're in the root (/) folder.
I'm working on a fix

This bug happens only in the "root" because mFile is empty in FileActivity when we're in the root (/) folder.

true, yes! 馃憤

@AndyScherzinger It has been fixed and tested on my own ("par mes soins" in french 馃嚝馃嚪 馃槃 ) in : https://github.com/nextcloud/android/pull/5465

I let you watch the PR

Have a nice day

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tobiasKaminsky picture tobiasKaminsky  路  3Comments

Bugsbane picture Bugsbane  路  3Comments

Shagequi picture Shagequi  路  3Comments

AndyScherzinger picture AndyScherzinger  路  3Comments

tobiasKaminsky picture tobiasKaminsky  路  3Comments