Unity_Android_Screen_Recorder icon indicating copy to clipboard operation
Unity_Android_Screen_Recorder copied to clipboard

Gives me an error of nosuchmethod at permission

Open AmitBagadaV opened this issue 7 years ago • 4 comments

Hi i have used your android screen recorder plugin from github in my project i have tested on my fresh new project its working fine but when i integrate in my real project it gives me

no such method error in this line : androidUtils.GetStatic<AndroidJavaObject>("currentActivity").Call("hasPermission", GetPermissionStrr(permission));

My unity version is 5.6.5 plugin used in my projects is easy movie texture and vuforia can you please help me on this.

AmitBagadaV avatar Sep 28 '18 05:09 AmitBagadaV

Have you included the plugin folder in your project. Could you give me the full details about the way you integrate this plugin so I can find your problem?

thanh-nguyen-kim avatar Sep 28 '18 07:09 thanh-nguyen-kim

So right now I am facing two problems

  1. Not able build my project with new unity-recorder.aar file which I have generated from my android studio steps that I follow for these, * Copy android unity recorder code in to my android studio * Follow your steps as per your link: Build guide: +Clone this project and open it using Android Studio. +In Gradle project: Navigate to Android_Screen_Recorder/unityrecorder/Tasks/build and double-click to "assembleRelease". +Wait for build process to complete then get your plugin in Android_Screen_Recorder/unityrecorder/build/generated/ outputs /aar/unityrecorder-release.aar +Use 7-zip to open this aar plugin and delete class.jar inside "libs" folder. You can read this blog to understand the reason which force us to delete the class.jar file. +Copy the modified unityrecorder-release.aar to Plugins/Android folder inside your project. * When I build my project it gives this error: * "Moving Temp/StagingArea/android-libraries/unityrecorder-release/classes.jar to Temp/StagingArea/android-libraries/unityrecorder-release/libs/classes.jar: No such file or directory"

  2. My second my problem is when I used your unity recorder-release.aar at that time I unable to call androidutils.java class because I have used vuforia plugin so vuforia plugin has its own activity that’s way it won’t call androidutils.java class when I call has permission method it gives me an error of "no such method" Error : AndroidJavaException: java.lang.NoSuchMethodError: no non-static method with name=‘hasPermission’ My Unity version is 5.6.5 Extra Plugin Used : * Vuforia plugin (ver 6.2.10) * Easy movie texture Plugin

AmitBagadaV avatar Sep 28 '18 10:09 AmitBagadaV

Hi Amit! For the first problem, Try to build the project without deleting the class.jar and may the odds ever in your favor. For the second one, I have been using this plugin with vuforia and everything is ok. Have you try to copy the plugin folder(dont forget the manifest.xml) from my Unity example instead of build a fresh one. If your product isn’t top-secret, share me your code(which is related to the plugin) i will have a look and reply you as soon as possible

thanh-nguyen-kim avatar Sep 29 '18 10:09 thanh-nguyen-kim

Hello Thanks for your reply i am attaching here my demo link with an error which i am facing my project.

https://www.dropbox.com/s/mgfuygboi2dxs6b/Demo_Screen_Recorder.zip?dl=0

kindly check it reply me if you facing any problem with it.

AmitBagadaV avatar Oct 01 '18 06:10 AmitBagadaV