Closed efraespada closed 4 years ago
@ilyasdirin I cloned the repo again. The sample project is building without problems on my computer. Have you tried to invalidate the Android Studio cache and restart it?
@ilyasdirin I cloned the repo again. The sample project is building without problems on my computer. Have you tried to invalidate the Android Studio cache and restart it?
@efraespada I tried many times with clear, invalidate even macbook restart. I think it may uses some kind of java library because when I build it in windows it asks for java permission. can that libraries may be missing in mac?
It shouldn't.
The SC plugin uses native libraries (dll
and dylib
), which are loaded in the Stark
class.
Dependencies on plugin:
dependencies {
implementation gradleApi()
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation group: 'com.google.guava', name: 'guava', version: '28.0-jre'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.1.0'
}
The stranger thing is that it is not working in both systems (Windows - MacOS).
@ilyasdirin did you build the app with ProGuard or R8 enabled?
@efraespada no I do not build app with ProGuard or R8. But if I achieve to build it I will eventually use it with proguard but for now I am not able to build it without proguard and R8.
Did you find a solution to overcome this error @ilyasdirin?
Same happens to me with the latest version 3.5, tried on Mac OS 10.13.6 with Android Studio 3.5.1.
Any ideas @efraespada ? I have noticed that it happens just when you specify stringFiles
option.
Hi @jiriklobasa
Does this error only happen when stringFiles
property is defined?
Are you getting any other error like this one?
Caused by: java.lang.UnsatisfiedLinkError: /private/var/folders/_t/ppptr4fs06gg1f38_bctzh3m0000gn/T/libsignKey.dylib5689898627273585595: dlopen(/private/var/folders/_t/ppptr4fs06gg1f38_bctzh3m0000gn/T/libsignKey.dylib5689898627273585595, 1): Symbol not found: __ZN5boost6system6detail24system_category_instanceE
Referenced from: /private/var/folders/_t/ppptr4fs06gg1f38_bctzh3m0000gn/T/libsignKey.dylib5689898627273585595
Expected in: /usr/local/opt/boost/lib/libboost_system.dylib
in /private/var/folders/_t/ppptr4fs06gg1f38_bctzh3m0000gn/T/libsignKey.dylib5689898627273585595
Hey @efraespada, yeah, from time to time this also appears. But when you clean the project up and rebuild it always ends with the java.lang.NoClassDefFoundError: Could not initialize class components.Stark
error.
Just to add the statement - stringFiles
property does not have impact on the error. You can just simply put an entry in strings.xml
file with hidden="true"
attribute and it crashes.
Hi @jiriklobasa
Does this error only happen when
stringFiles
property is defined?Are you getting any other error like this one?
Caused by: java.lang.UnsatisfiedLinkError: /private/var/folders/_t/ppptr4fs06gg1f38_bctzh3m0000gn/T/libsignKey.dylib5689898627273585595: dlopen(/private/var/folders/_t/ppptr4fs06gg1f38_bctzh3m0000gn/T/libsignKey.dylib5689898627273585595, 1): Symbol not found: __ZN5boost6system6detail24system_category_instanceE Referenced from: /private/var/folders/_t/ppptr4fs06gg1f38_bctzh3m0000gn/T/libsignKey.dylib5689898627273585595 Expected in: /usr/local/opt/boost/lib/libboost_system.dylib in /private/var/folders/_t/ppptr4fs06gg1f38_bctzh3m0000gn/T/libsignKey.dylib5689898627273585595
I do
@klozMobile are you using a macOS system? If that's the case, have you recently upgrade your system?
Same problem with me
@efraespada yes I'm using macOS catalina
after many trying, I think this problem com when to add cpp folder and add some native code to project I think there is some conflict with your project native code and our project I hope that help thanks in advanced
@MostafaAnter you are right. I've created a native C++ project and added SC. It returns the java.lang.UnsatisfiedLinkError
error at runtime.
SC uses the default name for the native library (native-lib
) and your native library overrides it.
I've just released v3.6.2
with a different native library name.
Thank you so much @MostafaAnter for your report 🙌
@jiriklobasa @klozMobile @ilyasdirin do you have a similar project case?
@efraespada so far so good now I can reveal and obfuscate any text on kotlin files but I still can't do hidden to my strings on res folder so this error show to me Library not loaded: /usr/local/opt/boost/lib/libboost_system.dylib
now I guess that is happened because of JDK on my device, so there is any suggestions
I think It's an error on the G++ compiler flags, some native libraries were not included in the SC native lib for macOS systems.
@MostafaAnter try with v3.6.3
.
Hi @efraespada, I have the same problem and I downloaded v3.6.3 but I have the same error whit v3.6.2
Library not loaded: /usr/local/opt/boost/lib/libboost_system.dylib Referenced from: /private/var/folders/rd/d5t6kngn69b4czf58f_8cxtr0000gn/T/libsignKey.dylib682191099424347482
Could you try v4.0.0
?
There is a new implementation, the plugin is applied per module:
apply plugin: 'com.android.application'
apply plugin: StringCare
stringcare {
debug true
assetsFiles = ["*.json"]
stringFiles = ['strings.xml']
srcFolders = ['src/main']
}
android {
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
repositories {
jcenter()
}
dependencies {
implementation "com.stringcare:library:$stringcare_version"
}
Hi @efraespada the v4.0.0 works for me but i have one question im trying to obfuscate the strings but the project have different project modules and i can't obfuscate the string of the others modules thanks
@guillermog888 I think that's because the plugin only controls (by the moment) the application module:
apply plugin: 'com.android.application'
apply plugin: StringCare
I'll try to fix that.
Hi @efraespada, I have the same problem and I downloaded v4.2.1 but I have the same error whit v4.2.1 I'm using macOS
@haitv2910 in which modules you were using Stringcare?
Just cloning this repo and building the project, we get this error: