Skip to content

Failing to build APK after updating to 7.5.0 #201

@Adrianogba

Description

@Adrianogba

Describe the bug
After upgrading freeRASP to version 7.5.0, the Android build fails due to an unresolved reference to ScreenProtector in the native Kotlin code. It seems that a required dependency is missing or not properly included.


To Reproduce

  1. Create or use an existing Flutter project
  2. Add freeRASP version 7.5.0 to pubspec.yaml
  3. Run flutter pub get
  4. Build the Android project (flutter build apk or run via Android Studio)

Error output

Got dependencies in `PROJECT_PATH`!
20 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
e: file:///DEPENDENCIES_PATH/hosted/pub.dev/freerasp-7.5.0/android/src/main/kotlin/com/aheaditec/freerasp/handlers/TalsecThreatHandler.kt:6:31 Unresolved reference 'ScreenProtector'.
e: file:///DEPENDENCIES_PATH/hosted/pub.dev/freerasp-7.5.0/android/src/main/kotlin/com/aheaditec/freerasp/handlers/TalsecThreatHandler.kt:29:13 Unresolved reference 'ScreenProtector'.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':freerasp:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 52s
Running Gradle task 'assembleRelease'...                           53,1s
Gradle task assembleRelease failed with exit code 1

Expected behavior
The project should build successfully without requiring any additional manual dependency configuration in the Android module.


Actual behavior
The build fails due to missing ScreenProtector class reference in the plugin's native Android code.


Workaround
Downgrading to version 7.4.0 resolves the issue.


Screenshots
Not applicable


Please complete the following information:

  • Device: Not device-specific (build-time issue)
  • OS version: Windows 11
  • Flutter version: 3.41.5
  • freeRASP version: 7.5.0

Additional context
It appears that the ScreenProtector class might belong to a dependency that is not being transitively included anymore (possibly from Talsec SDK).

Manually adding a dependency such as:

implementation 'com.aheaditec.talsec.security:security-android:<version>'

might resolve the issue, according to chatgpt, still didn't tested yet, but this should not be required, right?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions