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

Screenshot detect doesnot work on android #89

Open
Mr-Talha110 opened this issue May 2, 2024 · 6 comments
Open

Screenshot detect doesnot work on android #89

Mr-Talha110 opened this issue May 2, 2024 · 6 comments

Comments

@Mr-Talha110
Copy link

No description provided.

@rehamalraee24
Copy link

did you figure out the issue?

@Mr-Talha110
Copy link
Author

not yet it works perfectly on ios but not android.

@Project112224
Copy link

android 13 Permissions add

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

and user allow permission photos and video

use permission_handler and

await Permission.photos.request();

useful to me

@fishofeyes
Copy link

fishofeyes commented Jun 11, 2024

@AlexTs10
Copy link

It wasn't working for me either, added these three lines in the file below and now it works.
If some could make a pull request that would be nice.

`///Users/alextoska/.pub-cache/hosted/pub.dev/screenshot_callback-3.0.1/android/build.gradle
group 'com.flutter.moum.screenshot_callback'
version '1.0'

buildscript {
ext.kotlin_version = '1.6.10'

repositories {
    google()
    mavenCentral()
}

dependencies {
    classpath 'com.android.tools.build:gradle:7.1.2'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

}

rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
namespace 'com.flutter.moum.screenshot_callback' // Add this line
compileSdkVersion 33

defaultConfig {
    minSdkVersion 21
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
lintOptions {
    disable 'InvalidPackage'
}

//added this
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
//added this
kotlinOptions {
    jvmTarget = '1.8'
}

}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

repositories {
mavenCentral()
}
`

@Apliarte
Copy link

Apliarte commented Oct 3, 2024

For me, the solution of @AlexTs10 Thank you very much

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

6 participants