NativeScript / android

NativeScript for Android using v8
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
529 stars 135 forks source link

Error opening view: android.support.v7.widget.LinearLayoutManager is not a constructor #921

Closed rklde closed 6 years ago

rklde commented 6 years ago

Please, provide the details below:

Did you verify this is a real problem by searching [Stack Overflow]

yes

Tell us about the problem

After updating to 3.4.0 I get an stacktrace opening a view including a RadListView

Please provide the following version numbers that your issue occurs with:

Did the error happen while the app was being constructed? (buildtime error)

no

Did the error happen while the app was executing? (runtime error)

yes log.txt

Please tell us how to recreate the issue in as much detail as possible.

I have two ListViews with swipe actions in this View. I think they raise the stacktrace as I have no explicit LinearLayout but a Stacklayout with horizontal orientation, like this:

<lv:RadListView items="{{ baumschaeden }}" col="0" row="2" style="border-width:1; border-color:gray" id="schaedenListView"
                                        selectionBehavior="None"
                                        itemSwipeProgressStarted="onSchadenSwipeCellStarted"
                                        itemSwiping="onItemSwiping"
                                        swipeActions="true">
  <lv:RadListView.itemTemplate>
     <StackLayout orientation="horizontal" style="background-color: white;" class="itemStackLayout">
       <Label fontSize="16" text="{{ angelegtAm }}" class="titleLabel" width="15%"/>
       <Label fontSize="16" text="{{ schadensArt }}" class="titleLabel" width="40%"/>
       <Label fontSize="16" text="{{ schadensort }}" class="titleLabel" width="20%"/>
        <Switch checked="{{ behoben }}" class="field-switch" width="10%"/>
      </StackLayout>
    </lv:RadListView.itemTemplate>

    <lv:RadListView.itemSwipeTemplate>
         <GridLayout columns="*, auto" backgroundColor="White">
               <StackLayout id="delete-view" col="1" style="background-color: red;" tap="deleteSchaden" paddingLeft="16" paddingRight="16" orientation="horizontal">
               <Label text="Delete" style="text-size: 20" verticalAlignment="center" horizontalAlignment="center"/>
                </StackLayout>
           </GridLayout>
      </lv:RadListView.itemSwipeTemplate>
</lv:RadListView>
tgpetrov commented 6 years ago

Hi @rklde,

It looks like the nativescript-pro-ui plugin was not correctly upgraded. Can you try to execute:

tns platform remove android

and then run the application again.

If the issue persist can you try to reproduce it with the Pro UI's Examples app. It uses the same versions as in your app and also uses RadListView. Let me know how it goes.

rklde commented 6 years ago

Hi @tgpetrov,

thanks for your quick answer, removing android did work :-).