talsec / Free-RASP-Flutter

Flutter library for improving app security and threat monitoring on Android and iOS mobile devices.
https://github.com/talsec/Free-RASP-Community
MIT License
194 stars 20 forks source link

Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release #45

Closed GustavoFigueira closed 1 year ago

GustavoFigueira commented 1 year ago

Hi,

When running in Gitlab CI/CD, SOMETIMES the build crashes:

...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeProdReleaseAssets'.
> Could not resolve all files for configuration ':app:prodReleaseRuntimeClasspath'.
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app
      > Skipped due to earlier error
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app
      > Skipped due to earlier error
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app > project :freerasp
      > Skipped due to earlier error
* 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 6m 58s
Running Gradle task 'bundleProdRelease'...                        419.4s
Gradle task bundleProdRelease failed with exit code 1

Should I declare the package's Maven repositories? If yes, what is the URL?

Thanks.

yardexx commented 1 year ago

Hello @GustavoFigueira

That shouldn't be necessary - they are already declared in plugin.

Thanks for issue though, we will take look at it.

Jaroslav from Talsec Team.

GustavoFigueira commented 1 year ago

Oh ok!

That's my build.gradle dependency config:

dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation fileTree(dir: 'libs', include: ['.jar', '.aar']) implementation 'com.google.code.gson:gson:2.9.0' implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.okhttp3:okhttp:4.9.3' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" implementation 'com.google.android.gms:play-services-tagmanager:18.0.2' // Talsec Release releaseImplementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:-release' // Talsec Debug implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:-dev' }

And the full log from build:

$ flutter pub get
Running "flutter pub get" in ***...                        
Warning: You are using these overridden dependencies:
! intl 0.18.0
Running "flutter pub get" in ***...                           52.4s
$ flutter build appbundle --release --flavor prod --build-number $BUILD_NUMBER --target=lib/app/production.dart --target-platform=android-arm,android-arm64,android-x64
💪 Building with sound null safety 💪
Running Gradle task 'bundleProdRelease'...                      
Checking the license for package SDK Patch Applier v4 in /home/dev/android/licenses
License for package SDK Patch Applier v4 accepted.
Preparing "Install SDK Patch Applier v4 (revision: 1)".
"Install SDK Patch Applier v4 (revision: 1)" ready.
Installing SDK Patch Applier v4 in /home/dev/android/patcher/v4
"Install SDK Patch Applier v4 (revision: 1)" complete.
"Install SDK Patch Applier v4 (revision: 1)" finished.
Checking the license for package NDK (Side by side) 25.1.8937393 in /home/dev/android/licenses
License for package NDK (Side by side) 25.1.8937393 accepted.
Preparing "Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)".
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" ready.
Installing NDK (Side by side) 25.1.8937393 in /home/dev/android/ndk/25.1.8937393
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" complete.
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" finished.
Checking the license for package CMake 3.10.2.4988404 in /home/dev/android/licenses
License for package CMake 3.10.2.4988404 accepted.
Preparing "Install CMake 3.10.2.4988404 (revision: 3.10.2)".
"Install CMake 3.10.2.4988404 (revision: 3.10.2)" ready.
Installing CMake 3.10.2.4988404 in /home/dev/android/cmake/3.10.2.4988404
"Install CMake 3.10.2.4988404 (revision: 3.10.2)" complete.
"Install CMake 3.10.2.4988404 (revision: 3.10.2)" finished.
Checking the license for package Android Emulator in /home/dev/android/licenses
License for package Android Emulator accepted.
Preparing "Install Android Emulator (revision: 31.3.[14](https://gitlab.com/***/-/jobs/***#L14))".
"Install Android Emulator (revision: 31.3.14)" ready.
Installing Android Emulator in /home/dev/android/emulator
"Install Android Emulator (revision: 31.3.14)" complete.
"Install Android Emulator (revision: 31.3.14)" finished.
Checking the license for package Android SDK Tools in /home/dev/android/licenses
License for package Android SDK Tools accepted.
Preparing "Install Android SDK Tools (revision: 26.1.1)".
"Install Android SDK Tools (revision: 26.1.1)" ready.
Installing Android SDK Tools in /home/dev/android/tools
"Install Android SDK Tools (revision: 26.1.1)" complete.
"Install Android SDK Tools (revision: 26.1.1)" finished.
Checking the license for package Android SDK Build-Tools 30.0.2 in /home/dev/android/licenses
License for package Android SDK Build-Tools 30.0.2 accepted.
Preparing "Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)".
"Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)" ready.
Installing Android SDK Build-Tools 30.0.2 in /home/dev/android/build-tools/30.0.2
"Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)" complete.
"Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)" finished.
Checking the license for package Android SDK Platform 33 in /home/dev/android/licenses
License for package Android SDK Platform 33 accepted.
Preparing "Install Android SDK Platform 33 (revision: 2)".
"Install Android SDK Platform 33 (revision: 2)" ready.
Installing Android SDK Platform 33 in /home/dev/android/platforms/android-33
"Install Android SDK Platform 33 (revision: 2)" complete.
"Install Android SDK Platform 33 (revision: 2)" finished.
Checking the license for package Android SDK Platform 29 in /home/dev/android/licenses
License for package Android SDK Platform 29 accepted.
Preparing "Install Android SDK Platform 29 (revision: 5)".
"Install Android SDK Platform 29 (revision: 5)" ready.
Installing Android SDK Platform 29 in /home/dev/android/platforms/android-29
"Install Android SDK Platform 29 (revision: 5)" complete.
"Install Android SDK Platform 29 (revision: 5)" finished.
Checking the license for package Android SDK Platform 30 in /home/dev/android/licenses
License for package Android SDK Platform 30 accepted.
Preparing "Install Android SDK Platform 30 (revision: 3)".
"Install Android SDK Platform 30 (revision: 3)" ready.
Installing Android SDK Platform 30 in /home/dev/android/platforms/android-30
"Install Android SDK Platform 30 (revision: 3)" complete.
"Install Android SDK Platform 30 (revision: 3)" finished.
Checking the license for package Android SDK Platform 32 in /home/dev/android/licenses
License for package Android SDK Platform 32 accepted.
Preparing "Install Android SDK Platform 32 (revision: 1)".
"Install Android SDK Platform 32 (revision: 1)" ready.
Installing Android SDK Platform 32 in /home/dev/android/platforms/android-32
"Install Android SDK Platform 32 (revision: 1)" complete.
"Install Android SDK Platform 32 (revision: 1)" finished.
Checking the license for package Android SDK Platform 28 in /home/dev/android/licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in /home/dev/android/platforms/android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeProdReleaseAssets'.
> Could not resolve all files for configuration ':app:prodReleaseRuntimeClasspath'.
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app
      > Skipped due to earlier error
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app
      > Skipped due to earlier error
   > Could not resolve com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:4.2.3-release.
     Required by:
         project :app > project :freerasp
      > Skipped due to earlier error
* 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 6m 58s
Running Gradle task 'bundleProdRelease'...                        4[19](https://gitlab.com/***/-/jobs/***#L19).4s
Gradle task bundleProdRelease failed with exit code 1
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
yardexx commented 1 year ago

Hello @GustavoFigueira

Sorry for my previous answer but after you replied I have noticed that maven dependency will be needed.

Maven dependecies:

maven { url "https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp" }
maven { url "https://developer.huawei.com/repo/" }
// If you use freeRASP 4.0.0 then also this: 
maven { url 'https://jitpack.io/' }

By the way, is there any reason you have your own dependecy declared? They are inherited from plugin and also works in CI/CD as well, so something like this is not necessary:

implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Flutter:-dev'
msikyna commented 1 year ago

Hello @GustavoFigueira , did the solution help? Are you experiencing any issues now?

Kind regards, Matúš, Talsec dev

GustavoFigueira commented 1 year ago

Hi guys, I apologize for the delay in answering. Yeah, now it's working. I also updated the package to the last version (4.0.0).

Thanks!