nativescript-community / gesturehandler

Declarative API exposing platform native touch and gesture system to NativeScript.
Apache License 2.0
12 stars 3 forks source link

Plugin stopped working #6

Closed CatchABus closed 4 years ago

CatchABus commented 4 years ago

Which platform(s) does your issue occur on?

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

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

Installing plugin on a project and attempting to run app causes this error:

Webpack build done!
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\swmansion\gesturehandler\GestureHandlerOrchestrator.java:16: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:8: error: package org.nativescript.widgets does not exist
import org.nativescript.widgets.ItemSpec;
                               ^
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:9: error: package org.nativescript.widgets does not exist
import org.nativescript.widgets.GridUnitType;
                               ^
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:16: error: package org.nativescript.widgets does not exist
public class PageLayout extends org.nativescript.widgets.GridLayout {
                                                        ^
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\swmansion\gesturehandler\GestureHandlerRegistryImpl.java:12: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\swmansion\gesturehandler\GestureHandlerOrchestrator.java:327: error: cannot find symbol
  private boolean isViewAttachedUnderWrapper(@Nullable View view) {
                                              ^
  symbol:   class Nullable
  location: class GestureHandlerOrchestrator
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\swmansion\gesturehandler\GestureHandlerRegistryImpl.java:25: error: cannot find symbol
  public synchronized @Nullable GestureHandler getHandler(int handlerTag) {
                       ^
  symbol:   class Nullable
  location: class GestureHandlerRegistryImpl
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\swmansion\gesturehandler\GestureHandlerOrchestrator.java:334: error: cannot find symbol
    @Nullable ViewParent parent = view.getParent();
     ^
  symbol:   class Nullable
  location: class GestureHandlerOrchestrator
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:19: error: cannot find symbol
        addRow(new ItemSpec(1, GridUnitType.auto));
                   ^
  symbol:   class ItemSpec
  location: class PageLayout
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:19: error: cannot find symbol
        addRow(new ItemSpec(1, GridUnitType.auto));
                               ^
  symbol:   variable GridUnitType
  location: class PageLayout
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:20: error: cannot find symbol
        addRow(new ItemSpec(1, GridUnitType.star));
                   ^
  symbol:   class ItemSpec
  location: class PageLayout
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:20: error: cannot find symbol
        addRow(new ItemSpec(1, GridUnitType.star));
                               ^
  symbol:   variable GridUnitType
  location: class PageLayout
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:75: error: cannot find symbol
        super.requestDisallowInterceptTouchEvent(disallowIntercept);
        ^
  symbol:   variable super
  location: class PageLayout
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:91: error: cannot find symbol
        final boolean handled = super.dispatchTouchEvent(ev);
                                ^
  symbol:   variable super
  location: class PageLayout
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\PageLayout.java:128: error: incompatible types: PageLayout cannot be converted to ViewGroup
        this.mOrchestrator = new com.swmansion.gesturehandler.GestureHandlerOrchestrator(this, this.mRegistry, this.configurationHelper);
                                                                                         ^
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\RootViewGestureHandler.java:15: error: getView() in RootViewGestureHandler cannot override getView() in GestureHandler
    public PageLayout getView() {
                      ^
  return type PageLayout is not compatible with View
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\nativescript\gesturehandler\RootViewGestureHandler.java:16: error: incompatible types: View cannot be converted to PageLayout
        return (PageLayout)super.getView();
                                        ^
F:\my-workspace\ohoapp\platforms\tempPlugin\gesturehandler\src\main\java\com\swmansion\gesturehandler\ScaleGestureDetector.java:210: error: package R does not exist
        mMinSpan = res.getDimensionPixelSize(R.dimen.config_minPinchSpan);
                                              ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
18 errors
farfromrefug commented 4 years ago

@DimitrisRK can you try 0.1.19? should work now. Thanks for reporting

CatchABus commented 4 years ago

Thanks a lot for the quick response. It seems to be working for android now, though installed plugin module contains source files along with bundle file (is this expected behaviour?). Also, a test for iOS apps is needed as files seem quite different too in addition to NS6 version plugin. Screenshots among versions: iOS 0.1.16 image

iOS 0.1.19 image

farfromrefug commented 4 years ago

Yes that a major layout change i brought. Instead of "publishing" compiled native libs, i publish sources directly which will be build directly during your app build. I prefer that way because it makes debugging users build logs easier.

CatchABus commented 4 years ago

@farfromrefug Sorry, I'm not familiar with iOS and I noticed that new version is missing a file called "GestureHandler". I like this new approach.

farfromrefug commented 4 years ago

@DimitrisRK i like it too. However it requires to check and test your sources before publishing because you do not "compile" them. I will fix that though, i know how to do it

CatchABus commented 4 years ago

@farfromrefug One little thing I confirmed. In my case, this line is causing error during plugin manual build: https://github.com/nativescript-community/gesturehandler/blob/master/src-native/android/gesturehandler/build.gradle#L61 Removing it completely solved issues.

farfromrefug commented 4 years ago

yes that line should not be there anymore. But you should not go there anymore, right?

CatchABus commented 4 years ago

You are right. Just wanted to point it out, but forgot build is done in a different way now. :)

farfromrefug commented 4 years ago

Yes i will fix it! thanks, just did that the canvas. Now native is built to test on publish

farfromrefug commented 4 years ago

Actually still failing on iOS :( working on it but got some N issues now...)

CatchABus commented 4 years ago

Ah I see. I wish I had some mac equipment to help or report but my hands are tied here. I reopen this issue.

CatchABus commented 4 years ago

@farfromrefug Is this issue still open?

farfromrefug commented 4 years ago

Actually no. Thanks @DimitrisRK :)