forcedotcom / SalesforceMobileSDK-Android

Android SDK for Salesforce
Other
341 stars 386 forks source link

CipherMode couldn't be resolved in Debug Build Variant #2598

Open adriduttaheb opened 2 months ago

adriduttaheb commented 2 months ago

Please fill out the following details:

  1. Version of Mobile SDK Used: 12.0.1
  2. Issue found in Native App or Hybrid App: Native App
  3. OS Version: Any
  4. Device: Any
  5. Steps to reproduce: Add SalesforceMobileSDK-Android as a submodule and try to build on debug build variant
  6. Actual behavior: Compilation Error
  7. Expected Behavior: No Compilation Error
  8. Error Log: e: file:/StudioProjects//SalesforceMobileSDK-Android/libs/SalesforceSDK/src/com/salesforce/androidsdk/push/PushService.kt:249:53 Unresolved reference: CipherMode

Hi, I'm getting a weird build error where the kotlin debug compiler can't resolve CipherMode. It works great in the release build variant. I currently fixed this by extracting CipherMode out of the Encryptor class into it's own class. Just wanted to see if this could be fixed in the next release or if someone in salesforce is also experiencing this.

johnjeremih commented 2 months ago

I was having the same problem as well. I cannot find a solution.

Techfhil commented 5 days ago

Hi team,

I’m experiencing an unresolved reference error with CipherMode in the Debug build variant while using version 12.0.1 of the Mobile SDK. Here’s my approach to tackle this issue:

Verify Imports: I’ll double-check that all necessary imports for CipherMode are correctly included in PushService.kt.

Check Build Variants: I plan to review the build.gradle file for any inconsistencies affecting the Debug configuration.

Examine Compiler Settings: I'll ensure that the Kotlin compiler options are consistent between Debug and Release builds.

Inspect Dependencies: Running ./gradlew app:dependencies should help confirm that the SalesforceMobileSDK dependency is properly linked in the Debug variant.

Implement Workaround: Since I've extracted CipherMode into its own class, I’ll make sure it’s properly referenced in the Debug variant.

Request Support: Given that others are facing similar issues, it would be great to have insights from the Salesforce team for a fix in the next release.

I hope this helps clarify the situation