Comments (4)
Thank you, it's working now.
from androidlibrary.
@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.
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.
There was a bug. Compilations with no productFlavors
where not working. Update AndroidStringObfuscator.jar to latest version.
from androidlibrary.
Related Issues (20)
- Strings with the same content doesn't work properly HOT 49
- The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle
- Bug: cannot handle build variants properly HOT 42
- java.lang.NoClassDefFoundError: Could not initialize class components.Stark HOT 23
- java.lang.NoClassDefFoundError: Could not initialize class components.Stark
- compileSdkVersion is not specified HOT 2
- Library Support HOT 2
- Obfuscation library HOT 1
- Gradle crash HOT 12
- Resource not found HOT 3
- Task 'stringcareTestObfuscateDebug' not found in root project HOT 7
- What do you think about https://pypi.org/project/DeStringCare/ ? HOT 2
- Build: failed: Index: 1, Size: 1 HOT 2
- Execution failed for task ':app:generateDebugAssets' HOT 1
- JCenter Deprecation HOT 6
- Wiki update HOT 1
- migrate from AES/ECB/PKCS5Padding to AES/GCM/NoPadding. HOT 1
- Can't open the sample HOT 2
- Manifest merger failed : Attribute application@appComponentFactory
- Is this my version issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidlibrary.