Closed SwiftKayAndroid closed 6 years ago
I'm the Android expert here.
Getting features like proguard and minify to work with native libraries is tricky, and not something I really care to put the effort into. For now, consider that feature unsupported. If this feature is essential to you, and you would like to work on it yourself, the fix likely involves blacklisting the java classes that wrap the native library so that they do not get mangled in the minify process.
Matthew
On 7/3/2018 10:17 AM, SwiftKayAndroid wrote:
When using LSL I have no problem when minifyEnabled is set to false but once set to true the project will no longer run. Also this is an existing project that didn't have LSL and worked perected with minifyEnabled set to true all along until LSL was added. Here is the error I get.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':staging:transformClassesAndResourcesWithProguardForDemoRelease'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: Job failed, see logs for details at com.android.build.gradle.internal.transforms.ProGuardTransform.transform(ProGuardTransform.java:196) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102) at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212) at sun.reflect.GeneratedMethodAccessor564.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92) ... 32 more Caused by: java.io.IOException: Please correct the above warnings first. at proguard.Initializer.execute(Initializer.java:473) at proguard.ProGuard.initialize(ProGuard.java:233) at proguard.ProGuard.execute(ProGuard.java:98) at com.android.build.gradle.internal.transforms.BaseProguardAction.runProguard(BaseProguardAction.java:61) at com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:253) at com.android.build.gradle.internal.transforms.ProGuardTransform.access$000(ProGuardTransform.java:63) at com.android.build.gradle.internal.transforms.ProGuardTransform$1.run(ProGuardTransform.java:173) at com.android.builder.tasks.Job.runTask(Job.java:47) at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41) at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:282) ... 1 more
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/310, or mute the thread https://github.com/notifications/unsubscribe-auth/AFC33cEbghWiZgaHEG1tZrZ8liJr1WURks5uC6cagaJpZM4VBVee.
So basically LSL isn't supported on Android at all then because absolutely ZERO companies that have any valid interest in deploying an Android app aren't going to deploy without minifyEnabled set to true. So maybe putting in the lsl android page that if you have a respectable company then LSL wont work for your android project might be a good idea so people like me don't tell our bosses that LSL works with Android (which the android page for lsl misleads) and then our company has to cancel a contract with a third party because we gave them false information because your page gives US false information.
https://developer.android.com/studio/build/shrink-code#keep-code
Edit (sorry hit button too quickly). I did a quick search and found this. It seems like it would be good to do this for your project to see if it fixes the problem. If it does then maybe we can do it in the java-wrapped LSL just to prevent this question from coming up in the future. I'm not a Java or Android developer so I have no idea if this makes any sense.
BTW, @SwiftKayAndroid , there are many use cases where minifyEnabled is not necessary. Saying that because LSL does not currently* fit your use case then it doesn't fit anyone's use case is pretty self-centred and myopic, and is a pretty bad position to be attacking from.
Completely unrelated to the above, I wonder if you can define for me what it means to be a 'respectable company'?
SwiftKay, do you realize we don't charge for LSL, and none of the developers of LSL or organizations that support LSL make any money off it?
You come across like an entitled kid on his first real job. We don't work for you. If you want something, and we aren't interested in doing it, it is up to you to acquire the expertise necessary to implement the features you desire.
As far as you telling your boss that a library will work without effort for a given use case: Well, consider this a learning experience. Library integration always takes more effort that you'd like.
mgrivich, all I'm asking you to do is put a note in that its NOT supported on Android builds using any proguard since every single solitary developer on earth worth a lick will be using obfuscation especially since this targets medical uses and is extremely misleading, especially when LSL gets implemented and all the hours of work it takes to get it to work on Android because your documentation on how to get it to work is only partially complete and accurate, then you go to release and all that work is down the drain. Not really a crazy request to prevent developers from spending a few days working only to get it to work and then not be able to release.
With apologies I have the solution. I let my frustrations of a long day get to me. The issue was with the JNA library not playing well with proguard. I added the following to proguard and it worked.
-dontwarn java.awt. -keep class com.sun.jna. { ; } -keepclassmembers class extends com.sun.jna. { public ; }
I'm glad you got it working.
When using LSL I have no problem when minifyEnabled is set to false but once set to true the project will no longer run. Also this is an existing project that didn't have LSL and worked perected with minifyEnabled set to true all along until LSL was added. Here is the error I get.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':staging:transformClassesAndResourcesWithProguardForDemoRelease'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: Job failed, see logs for details at com.android.build.gradle.internal.transforms.ProGuardTransform.transform(ProGuardTransform.java:196) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102) at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212) at sun.reflect.GeneratedMethodAccessor564.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92) ... 32 more Caused by: java.io.IOException: Please correct the above warnings first. at proguard.Initializer.execute(Initializer.java:473) at proguard.ProGuard.initialize(ProGuard.java:233) at proguard.ProGuard.execute(ProGuard.java:98) at com.android.build.gradle.internal.transforms.BaseProguardAction.runProguard(BaseProguardAction.java:61) at com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:253) at com.android.build.gradle.internal.transforms.ProGuardTransform.access$000(ProGuardTransform.java:63) at com.android.build.gradle.internal.transforms.ProGuardTransform$1.run(ProGuardTransform.java:173) at com.android.builder.tasks.Job.runTask(Job.java:47) at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41) at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:282) ... 1 more