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

NoSuchMethodError #506

Closed
ahmadbajwa8282 opened this issue Aug 30, 2022 · 5 comments
Closed

NoSuchMethodError #506

ahmadbajwa8282 opened this issue Aug 30, 2022 · 5 comments

Comments

@ahmadbajwa8282
Copy link

ahmadbajwa8282 commented Aug 30, 2022

Caused by java.lang.NoSuchMethodError: no static method "Lorg/wysaid/nativePort/CGENativeLibrary;.loadTextureByName(Ljava/lang/String;)Lorg/wysaid/nativePort/CGENativeLibrary$TextureResult;"
at org.wysaid.nativePort.CGEImageHandler.nativeSetFilterWithConfig(CGEImageHandler.java)
at org.wysaid.nativePort.CGEImageHandler.setFilterWithConfig(CGEImageHandler.java:6)

I have tried adding
-keep class org.wysaid.nativePort.** { *; } in proguard.

Code:

val OVERLAY_EFFECTS = arrayOf(
      OverlayCode(""),
      OverlayCode("#unpack @krblend sr overlay/blend_1.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_2.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_3.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_4.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_5.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_6.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_7.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_8.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_9.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_10.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_11.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_12.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_13.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_14.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_15.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_16.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_17.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_18.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_19.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_20.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_21.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_22.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_23.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_24.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_25.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_26.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_27.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_28.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_29.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_30.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_31.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_32.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_33.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_34.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_35.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_36.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_37.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_38.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_39.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_40.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_41.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_42.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_43.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_44.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_45.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_46.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_47.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_48.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_49.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_50.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_51.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_52.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_53.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_54.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_55.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_56.webp 200"),
      OverlayCode("#unpack @krblend sr overlay/blend_57.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_58.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_59.webp 200", true),
      OverlayCode("#unpack @krblend sr overlay/blend_60.webp 200"))


  fun getListBitmapOverlayEffect(bitmap: Bitmap?): List<Bitmap?> {
      val arrayList: ArrayList<Bitmap?> = ArrayList()
      val sharedContext = SharedContext.create()
      sharedContext.makeCurrent()
      val cgeImageHandler = CGEImageHandler()
      cgeImageHandler.initWithBitmap(bitmap)
      for (filterBean in OVERLAY_EFFECTS) {
          cgeImageHandler.setFilterWithConfig(filterBean.image)
          cgeImageHandler.processFilters()
          arrayList.add(cgeImageHandler.resultBitmap)
      }
      sharedContext.release()
      return arrayList
  }
@ahmadbajwa8282
Copy link
Author

@wysaid kindly look into this.

@wysaid
Copy link
Owner

wysaid commented Sep 7, 2022

Please paste the whole demo than can produce your problem, then I can try to find the problem...

@ahmadbajwa8282
Copy link
Author

ahmadbajwa8282 commented Sep 7, 2022

@wysaid Dependency I was missing. The function above is the whole thing. I'm generating overlay from assets in my android app. This function works perfectly fine in debug build but in production NoSuchMethodError occurs.

   implementation 'org.wysaid:gpuimage-plus:2.4.6'
  maven {
            url 'http://maven.wysaid.org/'
            allowInsecureProtocol = true
        }

@wysaid
Copy link
Owner

wysaid commented Sep 14, 2022

Sorry for the late reply. You've closed this issue, is this problem solved?

@ahmadbajwa8282
Copy link
Author

Yeah, the issue was from my side. I added rules in the wrong proguard. 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