caffeinalab / ti.goosh

GCM/FCM module for Titanium.
MIT License
52 stars 34 forks source link

Uncaught Failed resolution of: Lcom/google/android/gms/common/GoogleApiAvailability; #96

Closed amigoni closed 6 years ago

amigoni commented 6 years ago

Sorry if this is a double post, I thought I posted it but I don't see it anymore. I am trying to build SDK with SDK 6.3.0. I know all these play services conflicts will be solved with 7.0 but not all modules are ready for that yet and it will be a while. The conflict is between Ti.Goosh and Ti.Map play services in order to avoid it I leave all original jars in Ti.Map and remove the base and basement from ti.goosh. They should be all the same version 10298000 of play services. It builds fine but the when registering for push I get the above error. I am suspecting something is missing from base and basement on the Ti.Map side.

I try to use proguard but there is no repository for 10298000 to be found and I have been unsuccessful in building one. Could anyone help with this one? Since titanium update I cannot revert to my last working configuration that was using SDK 6.0.4 and goosh 2.0.7. Thanks

amigoni commented 6 years ago

I tried removing all jar's from the map except the map they are version 10298000. I am keeping all the jar's that came with ti.goosh 3.0.3 changed the version.xml to 1029800 but get this TiExceptionHandler: (main) [1152,28615] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [1,28616] - In /app.js:740,17 [ERROR] : TiExceptionHandler: (main) [0,28616] - Message: Uncaught The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 11020000 but found 10298000. You must have the following declaration within the element: [ERROR] : TiExceptionHandler: (main) [0,28616] - Source: gcm.registerForPushNotifications({ [DEBUG] :

amigoni commented 6 years ago

I have tried again with proguard. here is the conf file.

-injars play-services-11.0.4
-outjars google-play-services-gcm+analytics+maps.jar

-libraryjars /adt-bundle-mac-x86_64-20131030/extras/android/support/v4/android-support-v4.jar
-libraryjars /adt-bundle-mac-x86_64-20131030/extras/android/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar
-libraryjars /adt-bundle-mac-x86_64-20131030/platforms/android-26/android.jar
-libraryjars /adt-bundle-mac-x86_64-20131030/platforms/android-25/android.jar
-libraryjars /adt-bundle-mac-x86_64-20131030/platforms/android-23/android.jar
-libraryjars /adt-bundle-mac-x86_64-20131030/platforms/android-22/android.jar

-dontoptimize
-dontobfuscate
-dontwarn com.google.**.R
-dontwarn com.google.**.R$*
-dontnote

-keep class * extends java.util.ListResourceBundle {
    protected java.lang.Object[][] getContents();
}

# 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;
}

# 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 *;
}

# Needed for Parcelable/SafeParcelable Creators to not get stripped
-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

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

# Keep metadata about included modules.
-keep public class com.google.android.gms.dynamite.descriptors.** {
  public <fields>;
}

# Keep the implementation of the flags api for google-play-services-flags

-keep public class com.google.android.gms.flags.impl.FlagProviderImpl {
  public <fields>; public <methods>;
}

-keep public class com.google.android.gms.common.** {
 public protected *;
}

-keep public class com.google.android.gms.analytics.** {
 public protected *;
}

-keep public class com.google.android.gms.maps.** {
 public protected *;
}

-keep public class com.google.android.gms.gcm.** {
 public protected *;
}
`

here is the error i keep getting

Reading library jar [/adt-bundle-mac-x86_64-20131030/platforms/android-22/android.jar] Warning: com.google.protobuf.zze: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze$zza: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze$zzb: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze$zzc: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze$zzd: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zze$zzd: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zzf: can't find referenced class sun.misc.Unsafe Warning: com.google.protobuf.zzf: can't find referenced class sun.misc.Unsafe Warning: there were 12 unresolved references to classes or interfaces. You may need to add missing library jars or update their versions. If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options. (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)`

Besides the goosh jar's i went and extrated the 11.0.4 map jar from the map .aar.

progress44 commented 6 years ago

Version 4 resolves this issue.