Giter VIP home page Giter VIP logo

Comments (4)

thaindq avatar thaindq commented on May 16, 2024 1

Thank you, it's working now.

from androidlibrary.

efraespada avatar efraespada commented on May 16, 2024

@thaindq I don't understand why you are setting mannually project.name and variant.dirName variables.

android.applicationVariants.all{ variant ->
    variant.mergeResources.doLast{
        println  ":" + project.name + ":initStringObfuscator"
        javaexec {
            main = "-jar";
            args = [
                  "../AndroidStringObfuscator.jar",
                  project.name,
                  variant.dirName
            ]
        }
    }
}

Seeing your Gradle output console, I think the script (JAR) is not detecting your current BuildVariant (productFlavors plus buildTypes).
JAR script is looking for debug buildVariant. Have you define some productFlavors?

args = [
     "../AndroidStringObfuscator.jar",
     "app",
     "your_product_flavor/debug"
]

If there is no productFlavor, remove ../ from variant.dirName and fingerprint:

args = [
    "../AndroidStringObfuscator.jar",
    "app",
    "debug"
]

But I don't recomend you to set it mannually 😅

from androidlibrary.

thaindq avatar thaindq commented on May 16, 2024

Hi, I had to set it manually, otherwise it couldn't detect the variant

args = [
    "../AndroidStringObfuscator.jar",
    project.name,
    variant.dirName
]

or

args = [
    "../AndroidStringObfuscator.jar",
    "app",
    "debug"
]

both gave me

:undefined:obfuscator-script - -----------------------------------------------------------------------------
:undefined:obfuscator-script - SHA1 fingerprint: E1:28:0C:3E:65:91:2E:21:E9:98:2B:58:80:9A:25:3A:F6:88:7D:FF
:undefined:obfuscator-script - variant not detected; try params [module] [variant] [optional:sha1]

I don't have any productFlavors, just buildTypes
Looking into your code, it seems like the variant is detected by /, that's why I tried to prepend ../

from androidlibrary.

efraespada avatar efraespada commented on May 16, 2024

There was a bug. Compilations with no productFlavors where not working. Update AndroidStringObfuscator.jar to latest version.

from androidlibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.