Android Studio Error - Error: Package Com.google.android.gms.games Does Not Exist

Discussion in 'Technical Discussion' started by phuceh, Sep 29, 2019.

  1. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    Hello,

    I am using Android Studio 3.5 and Buildbox 2.3.8.

    The build syncs fine in Android Studio but when generating the signed APK file I get the following error message -
    error: package com.google.android.gms.games does not exist

    I haven't changed anything from the file created by BuildBox when exporting to the Google Play store.

    Any help would be appreciated.

    Thanks
     
  2. GamerGhost

    GamerGhost Boxer

    Joined:
    Jan 25, 2019
    Messages:
    24
    Likes Received:
    11
    Buildbox exports does not work with Android 3.5.0.
    Do at least these addotions to your project:

    1. Add two lines in gradle.properties file:
    Code:
    android.useAndroidX=true
    android.enableJetifier=true
    
    2. Modify android manifest:

    Code:
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    ……….
    tools:replace="android:appComponentFactory"
    android:appComponentFactory="whateverString"
    …...
    <application android:label="@string/app_name"
    …...
    android:name="androidx.multidex.MultiDexApplication">
    
    3. Add these dependencies in build.gradle(app)

    Code:
    dependencies {
    implementation 'com.google.android.gms:play-services-auth:17.0.0'
    implementation 'com.google.android.gms:play-services-games:18.0.1'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    
    
    See also the following thread:
    https://www.buildbox.com/forum/index.php?threads/appodeal-integration.15485/#post-92210
     
    phuceh likes this.
  3. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @GamerGhost thanks a lot for your reply.

    Which version of Android Studio works with Buildbox exports? And if I use an earlier version will I still need to make those changes you mentioned?
     
  4. GamerGhost

    GamerGhost Boxer

    Joined:
    Jan 25, 2019
    Messages:
    24
    Likes Received:
    11
    I think that with 3.2.1 grade you do not need my modifications for gradle.properties and android manifest except dependencies. Also I forgot to mention the following:
    Code:
    implementation 'com.google.android.gms:play-services-ads:18.2.0' // version number is depending on your project
    
     
    phuceh likes this.
  5. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @GamerGhost I really appreciate your help here. I will try it with 3.2.1 and the dependency changes you mentioned.
     
    GamerGhost likes this.
  6. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @GamerGhost I am able to compile the APK, but the game closes after loading on my phone and in Nox. I realise this is a different issue but maybe it's to do with this line that you mentioned -

    Code:
    implementation 'com.google.android.gms:play-services-ads:18.2.0'
    When you say the version number is depending on my project - do you mean the version code (number) in the Android Manifest XML?
     
    Last edited: Oct 1, 2019
  7. GamerGhost

    GamerGhost Boxer

    Joined:
    Jan 25, 2019
    Messages:
    24
    Likes Received:
    11
  8. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @GamerGhost thanks again for your help. This is starting to get really technical now. It's a bit ironic that I use BuildBox because I'm not that technical and don't code, but then I have to change code in Android Studio. I don't understand how a game that is exported from BuildBox requires so much alteration outside of BuildBox. I thought the software would create a version that is Android Studio compatible without the need for changing code and debugging. Anyway, rant over!
     
  9. GamerGhost

    GamerGhost Boxer

    Joined:
    Jan 25, 2019
    Messages:
    24
    Likes Received:
    11
    @phuceh BB2 requires a knowledge of Android studio and java. However the biggest problem is the lack of support from Buildbox stuff. If you want to be serious with game development especially with Android + ADS you need a Java programmer on your team. I am a programmer but unfortunately in visual studio and C#. Now I must learn Java because it is impossible to add ads in my game without coding.

    Only iOS + BB2 without ads is #nocode
     
  10. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @GamerGhost I understand - and I agree there does seem to be a lack of support. I would imagine it would be in their best interests to provide up to date tutorials and how to guides because it will help their retention business in the long run.

    Anyway, good luck with your game making and thanks for taking the time to respond.
     

Share This Page