pbakondy / cordova-plugin-sim

:cherries: A cordova plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, etc)
MIT License
163 stars 100 forks source link

contextcompat.checkselfpermission not working #44

Closed PremkumarAgrawal closed 7 years ago

PremkumarAgrawal commented 7 years ago

Hey @pbakondy I am facing error while building my app, at this line, in sim.java file at line number 233,

ContextCompat.checkSelfPermission(this.cordova.getActivity(), type));

pbakondy commented 7 years ago

not enough information

what is the error? environment? etc

On 25 Nov 2016 11:24, "Premkumar Agrawal" notifications@github.com wrote:

Hey @pbakondy https://github.com/pbakondy I am facing error while building my app, at this line, in sim.java file at line number 233,

ContextCompat.checkSelfPermission(this.cordova.getActivity(), type));

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pbakondy/cordova-plugin-sim/issues/44, or mute the thread https://github.com/notifications/unsubscribe-auth/AAej2XBgE6qlFnjjf-oz5SXoDXfDOnFmks5rBrdWgaJpZM4K8TL6 .

PremkumarAgrawal commented 7 years ago

After hitting ionic run android I am getting following response on command prompt,

`F:\A_LHS_Projects\DynamicApp\DA_Code\DynamicApp_V2\platforms\android\src\com\pbakondy\Sim.java:233: error: cannot find symbol ContextCompat.checkSelfPermission(this.cordova.getActivity(), type)); ^ symbol: method checkSelfPermission(Activity,String) location: class ContextCompat

Note: Some input files use or override a deprecated API.

FAILED

Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 13.068 secs

Error: Error code 1 for command: cmd with args: /s,/c,"F:\A_LHS_Projects\DynamicApp\DA_Code\DynamicApp_V2\platforms\android\gradlew cdvBuildDebug -b F:\A_LHS_Projects\DynamicApp\DA_Code\DynamicApp_V2\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

F:\A_LHS_Projects\DynamicApp\DA_Code\DynamicApp_V2>`

PremkumarAgrawal commented 7 years ago

Hey @pbakondy did you understood the issue..

pbakondy commented 7 years ago

Did you install Android requirements? https://github.com/pbakondy/cordova-plugin-sim#requirements

PremkumarAgrawal commented 7 years ago

@pbakondy I have following support files of Android SDK installed capture

pbakondy commented 7 years ago

What is the version of Android Support Library? Please run Android SDK Manager and install latest packages. Which SDK are you using?

PremkumarAgrawal commented 7 years ago

@pbakondy My Android SDK version is 6.0 (API 23)

Android Support Library 23.2.1

capture

pbakondy commented 7 years ago

Ok, let's try something else. I will make a few code changes, could you try it for me by installing it from github?

On 25 Nov 2016 13:21, "Premkumar Agrawal" notifications@github.com wrote:

@pbakondy https://github.com/pbakondy My Android SDK version is 6.0 (API 23)

Android Support Library 23.2.1 capture

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pbakondy/cordova-plugin-sim/issues/44#issuecomment-262945962, or mute the thread https://github.com/notifications/unsubscribe-auth/AAej2ZEL28JOV7kdA_5D2uRyPfTzC0NDks5rBtKxgaJpZM4K8TL6 .

PremkumarAgrawal commented 7 years ago

Yaa Sure... @pbakondy

pbakondy commented 7 years ago

Please try install the latest:

cordova plugin rm cordova-plugin-sim
cordova plugin add https://github.com/pbakondy/cordova-plugin-sim.git
PremkumarAgrawal commented 7 years ago

Should i run both the commands

PremkumarAgrawal commented 7 years ago

Hey @pbakondy have some urgent work.. will try later and get back to you...

Thanks for your instant support....

pbakondy commented 7 years ago

Yes, both commands The first one removes the installed plugin from npm, the second one installs the latest code

PremkumarAgrawal commented 7 years ago

Hey @pbakondy I installed SIM plugin successfully, & its working finely. Thanks for your support..

bkiruthiga commented 5 years ago

Hi. what changes have you made in the code. I am facing the same issue.. please mention the changes, it will be useful for me. Thanks in advance