playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.47k stars 967 forks source link

about Gradle + Proguard #1960

Closed kenglou closed 7 years ago

kenglou commented 7 years ago

I had tried the Gradle + Proguard but I found that I need to have the proguard file content, can anyone share with me on what should i keep and avoid stripped off?

Currently this is what I'm using:

 # Google Play Services
-keepattributes *Annotation*

# Proguard flags for consumers of the Google Play services SDK
# https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project

# Keep SafeParcelable value, needed for reflection. This is required to support backwards
# compatibility of some classes.
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

# Needed for Parcelable/SafeParcelable classes & their creators to not get renamed, as they are
# found via reflection.
-keep class com.google.android.gms.common.internal.ReflectedParcelable
-keepnames class * implements com.google.android.gms.common.internal.ReflectedParcelable
-keepclassmembers class * implements android.os.Parcelable {
  public static final *** CREATOR;
}

# Keep the classes/members we need for client functionality.
-keep @interface android.support.annotation.Keep
-keep @android.support.annotation.Keep class *
-keepclasseswithmembers class * {
  @android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
  @android.support.annotation.Keep <methods>;
}

# Keep the names of classes/members we need for client functionality.
-keep @interface com.google.android.gms.common.annotation.KeepName
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
  @com.google.android.gms.common.annotation.KeepName *;
}

# Keep Dynamite API entry points
-keep @interface com.google.android.gms.common.util.DynamiteApi
-keep @com.google.android.gms.common.util.DynamiteApi public class * {
  public <fields>;
  public <methods>;
}

# Needed when building against pre-Marshmallow SDK.
-dontwarn android.security.NetworkSecurityPolicy

# Needed when building against Marshmallow SDK.
-dontwarn android.app.Notification

# Needed for isDeviceProtectedStorage when building against a pre-Nougat SDK.
-dontwarn android.content.Context

-dontwarn com.google.android.gms.**
-keep public class com.google.android.gms.** { public *; }
-keep public class com.google.games.bridge.**{*;}

But I am getting below message when i run the plugin:

 10-05 18:15:24.163: E/GamesNativeSDK(22029): Exception in dalvik/system/DexClassLoader.loadClass: java.lang.IncompatibleClassChangeError: 
Superclass com.google.android.gms.nearby.connection.Connections$ConnectionRequestListener of com.google.android.gms.games.nearby.NativeConnectionRequestListener is an interface 
(declaration of 'com.google.android.gms.games.nearby.NativeConnectionRequestListener' appears in /data/data/com.xxx.apptest/app_.gpg.classloader/9fc5eaac3813d9502e2c301f2645e6da_nearby.jar).

Has anyone met this before and has a clue for it?

I'm actually trying to use the Proguard-User.txt file in Unity 2017.1 to strip of all my codes and I'm facing the problem right now in PlayGamesServices Plugin.

kenglou commented 7 years ago

I found that when i wanted to try the android gradle prebuild options, i keep getting the error message below:

Error somewhere in the process of creating the gradle build, executing it, and copying the outputs.
This will break dependency resolution and your build will not run.
See the output below for possible gradle build errors. The most likely cases are: an invalid bundleID (which you can correct in the Android Player Settings), or a failure to determine the Android SDK platform and build tools verison (you can verify that you have a valid android SDK path in the Unity preferences.
If you're not able to diagnose the error, please report a bug at: https://github.com/googlesamples/unity-jar-resolver/issuesA possible work-around is to turn off the "Gradle Prebuild" from the Jar Resolver Settings.

Error (1):
Traceback (most recent call last):
  File "Temp/PlayServicesResolverGradlePrebuild/generate_gradle_prebuild.py", line 476, in <module>
    sys.exit(main())
  File "Temp/PlayServicesResolverGradlePrebuild/generate_gradle_prebuild.py", line 468, in main
    generate_gradle_build(build_path, jsobj)
  File "Temp/PlayServicesResolverGradlePrebuild/generate_gradle_prebuild.py", line 215, in generate_gradle_build
    ignore=shutil.ignore_patterns("*.meta"))
  File "Temp/PlayServicesResolverGradlePrebuild/generate_gradle_prebuild.py", line 76, in merge_dir_tree
    paths = os.listdir(src)
OSError: [Errno 2] No such file or directory: 'https://maven.google.com'

UnityEngine.Debug:LogError(Object)
GooglePlayServices.<RunGenGradleScript>c__AnonStoreyE:<>m__11(Result)
GooglePlayServices.ProgressReporter:Update(CommandLineDialog)
GooglePlayServices.CommandLineDialog:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

has anyone met such issue and has a solution? I did try to change the "https://maven.google.com" to "https://dl.google.com/dl/android/maven2/" but seems has no luck, I didn't change anything on the router settings. I did successfully do a build from Android Studio for cocos2dx games before but it seems like i have no luck here...

kenglou commented 7 years ago

I do a command "./gradlew assembleDebug --debug" on the GenGradle folder and below are the output. Hope that helps.

12:00:19.848 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: /Users/appxplore14/.gradle/native
12:00:20.267 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Executing build 45f68682-9e1b-45b6-b6e5-dea8bf6ab179.1 in daemon client {pid=2881}
12:00:20.280 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface utun0
12:00:20.283 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
12:00:20.283 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
12:00:20.287 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:5b83:4469:3463:4bc1%utun0
12:00:20.288 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface utun0
12:00:20.288 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface en0
12:00:20.288 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
12:00:20.288 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
12:00:20.288 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:1827:781:8fc9:41b1%en0
12:00:20.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.0.151
12:00:20.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface en0
12:00:20.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface lo0
12:00:20.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
12:00:20.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
12:00:20.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Ignoring remote address on loopback interface /fe80:0:0:0:0:0:0:1%lo0
12:00:20.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1
12:00:20.290 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
12:00:20.290 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback multicast interface lo0
12:00:20.299 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
12:00:20.300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
12:00:20.308 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
12:00:20.314 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Attempting to connect to [8a6d04d7-779b-4814-96b8-618f9d0e2a84 port:52219, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]].
12:00:20.315 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Trying to connect to address /0:0:0:0:0:0:0:1.
12:00:20.336 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Connected to address /0:0:0:0:0:0:0:1:52219.
12:00:20.377 [INFO] [org.gradle.launcher.daemon.client.DaemonClient] Connected to daemon DaemonInfo{pid=2854, address=[8a6d04d7-779b-4814-96b8-618f9d0e2a84 port:52219, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1507521572048, context=DefaultDaemonContext[uid=2308c6ef-ae58-4eaf-8194-6901e48953b0,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home,daemonRegistryDir=/Users/appxplore14/.gradle/daemon,pid=2854,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=45f68682-9e1b-45b6-b6e5-dea8bf6ab179.1, currentDir=/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle}.
12:00:20.377 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Build
12:00:20.440 [INFO] [org.gradle.launcher.daemon.client.DaemonClient] Received result org.gradle.launcher.daemon.protocol.BuildStarted@1e81f160 from daemon DaemonInfo{pid=2854, address=[8a6d04d7-779b-4814-96b8-618f9d0e2a84 port:52219, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1507521572048, context=DefaultDaemonContext[uid=2308c6ef-ae58-4eaf-8194-6901e48953b0,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home,daemonRegistryDir=/Users/appxplore14/.gradle/daemon,pid=2854,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be starting).
12:00:20.427 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 2854). The daemon log file: /Users/appxplore14/.gradle/daemon/3.2.1/daemon-2854.out.log
12:00:20.430 [INFO] [org.gradle.launcher.daemon.server.exec.LogAndCheckHealth] Starting 2nd build in daemon [uptime: 48.846 secs, performance: 95%, no major garbage collections]
12:00:20.438 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
12:00:20.439 [INFO] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=2308c6ef-ae58-4eaf-8194-6901e48953b0,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home,daemonRegistryDir=/Users/appxplore14/.gradle/daemon,pid=2854,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
12:00:20.449 [INFO] [org.gradle.internal.buildevents.BuildLogger] Starting Build
12:00:20.450 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Gradle user home: /Users/appxplore14/.gradle
12:00:20.450 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Current dir: /Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle
12:00:20.450 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Settings file: null
12:00:20.450 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Build file: null
12:00:20.451 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Starting to build the build sources.
12:00:20.451 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Gradle source dir does not exist. We leave.
12:00:20.451 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found env project properties: []
12:00:20.452 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found system project properties: []
12:00:20.455 [DEBUG] [org.gradle.initialization.ScriptEvaluatingSettingsProcessor] Timing: Processing settings took: 0.003 secs
12:00:20.455 [INFO] [org.gradle.internal.buildevents.BuildLogger] Settings evaluated using settings file '/master/settings.gradle'.
12:00:20.456 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Transitioning model element '<root>' from state Registered to Created
12:00:20.457 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Transitioning model element '<root>' to state Discovered.
12:00:20.457 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Transitioning model element '<root>' to state Created.
12:00:20.458 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks' (hidden = false)
12:00:20.458 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Transitioning model element 'tasks' from state Registered to Created
12:00:20.459 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Running model element 'tasks' rule action Project.<init>.tasks()
12:00:20.459 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Mutating tasks using Project.<init>.tasks()
12:00:20.459 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Transitioning model element 'tasks' to state Discovered.
12:00:20.459 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Running model element 'tasks' rule action Project.<init>.tasks()
12:00:20.460 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Mutating tasks using Project.<init>.tasks()
12:00:20.460 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Transitioning model element 'tasks' to state Created.
12:00:20.460 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'serviceRegistry' (hidden = true)
12:00:20.461 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'buildDir' (hidden = true)
12:00:20.462 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'projectIdentifier' (hidden = true)
12:00:20.462 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'extensionContainer' (hidden = true)
12:00:20.462 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'fileOperations' (hidden = true)
12:00:20.462 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'sourceDirectorySetFactory' (hidden = true)
12:00:20.463 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'taskFactory' (hidden = true)
12:00:20.463 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'instantiator' (hidden = true)
12:00:20.463 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'typeConverter' (hidden = true)
12:00:20.463 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'nodeInitializerRegistry' (hidden = true)
12:00:20.464 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'structBindingsStore' (hidden = true)
12:00:20.464 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'proxyFactory' (hidden = true)
12:00:20.464 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'schemaStore' (hidden = true)
12:00:20.465 [DEBUG] [org.gradle.initialization.ProjectPropertySettingBuildLoader] Looking for project properties from: /Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/gradle.properties
12:00:20.465 [DEBUG] [org.gradle.initialization.ProjectPropertySettingBuildLoader] project property file does not exists. We continue!
12:00:20.465 [INFO] [org.gradle.internal.buildevents.BuildLogger] Projects loaded. Root project using build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle'.
12:00:20.465 [INFO] [org.gradle.internal.buildevents.BuildLogger] Included projects: [root project 'GenGradle']
12:00:20.466 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.init' (hidden = false)
12:00:20.467 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.wrapper' (hidden = false)
12:00:20.468 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.help' (hidden = false)
12:00:20.469 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.projects' (hidden = false)
12:00:20.469 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.tasks' (hidden = false)
12:00:20.469 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.properties' (hidden = false)
12:00:20.469 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.dependencyInsight' (hidden = false)
12:00:20.470 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.dependencies' (hidden = false)
12:00:20.470 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.buildEnvironment' (hidden = false)
12:00:20.470 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.components' (hidden = false)
12:00:20.471 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.model' (hidden = false)
12:00:20.471 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Project : - Registering model element 'tasks.dependentComponents' (hidden = false)
12:00:20.471 [INFO] [org.gradle.configuration.project.BuildScriptProcessor] Evaluating root project 'GenGradle' using build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle'.
12:00:20.473 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on cp_proj remapped class cache for brtxqr364tz4ztj2zevcu9jb (/Users/appxplore14/.gradle/caches/3.2.1/scripts-remapped/build_a6x5nkaixw52oba4wxyaqpfde/brtxqr364tz4ztj2zevcu9jb/cp_proj1c0099b63a3e82c6bf169f629bb20cd4).
12:00:20.474 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
12:00:20.474 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj remapped class cache for brtxqr364tz4ztj2zevcu9jb (/Users/appxplore14/.gradle/caches/3.2.1/scripts-remapped/build_a6x5nkaixw52oba4wxyaqpfde/brtxqr364tz4ztj2zevcu9jb/cp_proj1c0099b63a3e82c6bf169f629bb20cd4).
12:00:20.474 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on cp_proj remapped class cache for brtxqr364tz4ztj2zevcu9jb (/Users/appxplore14/.gradle/caches/3.2.1/scripts-remapped/build_a6x5nkaixw52oba4wxyaqpfde/brtxqr364tz4ztj2zevcu9jb/cp_proj1c0099b63a3e82c6bf169f629bb20cd4).
12:00:20.475 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
12:00:20.475 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on cp_proj generic class cache for build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle' (/Users/appxplore14/.gradle/caches/3.2.1/scripts/brtxqr364tz4ztj2zevcu9jb/cp_proj/cp_proj1c0099b63a3e82c6bf169f629bb20cd4).
12:00:20.476 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
12:00:20.476 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj generic class cache for build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle' (/Users/appxplore14/.gradle/caches/3.2.1/scripts/brtxqr364tz4ztj2zevcu9jb/cp_proj/cp_proj1c0099b63a3e82c6bf169f629bb20cd4).
12:00:20.476 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on cp_proj generic class cache for build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle' (/Users/appxplore14/.gradle/caches/3.2.1/scripts/brtxqr364tz4ztj2zevcu9jb/cp_proj/cp_proj1c0099b63a3e82c6bf169f629bb20cd4).
12:00:20.476 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
12:00:20.477 [INFO] [org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler] Compiling build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle' using SubsetScriptTransformer.
12:00:20.479 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj generic class cache for build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle' (/Users/appxplore14/.gradle/caches/3.2.1/scripts/brtxqr364tz4ztj2zevcu9jb/cp_proj/cp_proj1c0099b63a3e82c6bf169f629bb20cd4).
12:00:20.480 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj remapped class cache for brtxqr364tz4ztj2zevcu9jb (/Users/appxplore14/.gradle/caches/3.2.1/scripts-remapped/build_a6x5nkaixw52oba4wxyaqpfde/brtxqr364tz4ztj2zevcu9jb/cp_proj1c0099b63a3e82c6bf169f629bb20cd4).
12:00:20.481 [DEBUG] [org.gradle.configuration.project.BuildScriptProcessor] Timing: Running the build script took 0.009 secs
12:00:20.483 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
12:00:20.483 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
12:00:20.483 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
12:00:20.483 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where:
12:00:20.483 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle' line: 3
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Could not compile build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle'.
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > startup failed:
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle': 3: Ambiguous expression could be either a parameterless closure expression or an isolated open code block;
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]      solution: Add an explicit closure parameter list, e.g. {it -> ...}, or force it to be treated as an open block by giving it a label, e.g. L:{...} @ line 3, column 14.
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]      buildscript {{
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]                   ^
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   
12:00:20.484 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   1 error
12:00:20.485 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
12:00:20.485 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
12:00:20.485 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
12:00:20.485 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 
12:00:20.485 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 
12:00:20.485 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED
12:00:20.485 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 
12:00:20.485 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] Total time: 0.956 secs
12:00:20.486 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Plugin Resolution Cache (/Users/appxplore14/.gradle/caches/3.2.1/plugin-resolution) was closed 0 times.
12:00:20.487 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has finished executing the build.
12:00:20.542 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientInputForwarder] Dispatching close input message: org.gradle.launcher.daemon.protocol.CloseInput@3d681326
12:00:20.542 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 13: dispatching class org.gradle.launcher.daemon.protocol.CloseInput
12:00:20.543 [INFO] [org.gradle.launcher.daemon.client.DaemonClient] Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle' line: 3
Could not compile build file '/Volumes/Data/SVN/plugins/Unity5Plugins/GameServicePlugin/Temp/GenGradle/build.gradle'.] from daemon DaemonInfo{pid=2854, address=[8a6d04d7-779b-4814-96b8-618f9d0e2a84 port:52219, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1507521572048, context=DefaultDaemonContext[uid=2308c6ef-ae58-4eaf-8194-6901e48953b0,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home,daemonRegistryDir=/Users/appxplore14/.gradle/daemon,pid=2854,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
12:00:20.544 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Finished
12:00:20.545 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: connection stop
qbit86 commented 7 years ago

I'm actually trying to use the Proguard-User.txt file in Unity 2017.1 to strip of all my codes

Then you probably should specify -dontobfuscate. I mean: you don't really want to obfuscate Java-part of your game, you just want to minify it. And obfuscation can result in a lot of obscure errors. It's better to deal with errors related to stripping off than related to both shrinking and obfuscating.

kenglou commented 7 years ago

ok. got it. Thanks :)

qbit86 commented 7 years ago

can anyone share with me on what should i keep and avoid stripped off?

I'm solving similar issues, migrating to Gradle from legacy Internal build system. So I'm also interested in safe way of shrinking.

What I'm doing, is searching for NoSuchMethodErrors in LogCat, e.g.:

java.lang.NoSuchMethodError: no static method with name='enableLogging' signature='(Z)Z' in class Ljava.lang.Object;

Then I add -keep*** to proguard-user.txt:

-keepclasseswithmembers class * {
    public static boolean enableLogging(boolean);
}

Also I've added known whole packages:

-keep class com.appsflyer.** { *; }
-keep class com.facebook.** { *; }
-keep class com.fyber.** { *; }
-keep class com.prime31.** { *; }
-keep class com.unity3d.** { *; }