Error: Didn't find class "com.google.android.gms.common.ConnectionResult

1,046 views
Skip to first unread message

Gerry Fan

unread,
Mar 8, 2015, 10:00:59 PM3/8/15
to andro...@googlegroups.com
I took sample Native-activity, adding google-play-services to get a game service point, but I get lot of errors that could not find gms classes: 
E/GamesNativeSDK(31779): Exception in java/lang/ClassLoader.loadClass: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.ConnectionResult" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]].
E/GamesNativeSDK(31779): Exception in java/lang/ClassLoader.loadClass: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.GooglePlayServicesUtil" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]].
E/GamesNativeSDK(31779): Exception in java/lang/ClassLoader.loadClass: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]].
....

The code section is like this: 
      gpg::AndroidInitialization::android_main(app_state);
      plat_config_.SetActivity(app_state->activity->clazz);

      gpg::GameServices::Builder  my_builder;
      my_builder.SetOnLog([this](gpg::LogLevel level, std::string const &msg) {
                          onLogCallback(level, msg);}, gpg::LogLevel::VERBOSE)
          .SetOnAuthActionStarted([this](gpg::AuthOperation op) {
                  onAuthStarted(op);})
          .SetOnAuthActionFinished([this](gpg::AuthOperation op, gpg::AuthStatus status) {
              onAuthActionFinsihed(op, status);})
          .SetOnMultiplayerInvitationEvent([this](gpg::MultiplayerEvent event, std::string match_id, gpg::MultiplayerInvitation invitation){
              onMultiplayerInvitationEvent(event, match_id, invitation);});

      LOGI("gfan: Pre-Create");
      gpg_services_ = my_builder.Create(plat_config_);
      LOGI("gfan: Creating the Services done");
   
LOCAL_MODULE    := SimpleTriangle
LOCAL_SRC_FILES := main_entry.cpp game_engine.cpp game_helper.cpp gpg_helper.cpp
LOCAL_CFLAGS    :=
LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2
LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue ndk_helper gpg-1 gnustl-static
LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. $(NDK_MODULE_PATH)/gpg-cpp-sdk/android/include

#hard-fp setting
ifneq ($(filter %armeabi-v7a,$(TARGET_ARCH_ABI)),)
  #For now, only armeabi-v7a is supported for hard-fp
  #adding compiler/linker flags specifying hard float ABI for user code and math library
  LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
  LOCAL_LDLIBS += -lm_hard
  ifeq (,$(filter -fuse-ld=mcld,$(APP_LDFLAGS) $(LOCAL_LDFLAGS)))
    #Supressing warn-mismatch warnings
    LOCAL_LDFLAGS += -Wl,--no-warn-mismatch
  endif
endif


include $(BUILD_SHARED_LIBRARY)

$(call import-module,android/ndk_helper)
$(call import-module,gpg-cpp-sdk/android)
$(call import-module,android/native_app_glue)


logcat_error.txt

Gerry Fan

unread,
Mar 10, 2015, 12:16:00 AM3/10/15
to andro...@googlegroups.com
update -- it was fixed by removing "hasCode=true" in AndroidManifest. It seems "hasCode" could not be true:   
    <application android:label="@string/app_name">

RUBAN

unread,
Mar 10, 2015, 7:53:10 PM3/10/15
to andro...@googlegroups.com
Great.You solved it by yourself.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/d/optout.



--
Thanks&Regards,
J.Ruban
Email         : ruban...@gmail.com
Blog           : http://www.rubanbtech.blogspot.in/
                   : http://buildingmobileapp.wordpress.com/


Johan Euphrosine

unread,
Nov 16, 2015, 9:13:28 PM11/16/15
to android-ndk
Note that more recent version of gpg-cpp-sdk expect hasCode=true.
Reply all
Reply to author
Forward
0 new messages