Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Cannot find classes in Google's Play Core Library

Discussion in 'Android' started by FlowORemi, Mar 9, 2021.

  1. FlowORemi

    FlowORemi

    Joined:
    Apr 26, 2019
    Posts:
    7
    To implement In app update service in my live app, Here is What I've Tried .

    Environment
    -Unity version : 2019.4.18f LTS
    -Android Studio : 4.1.0


    1. Made my own .aar plugin and Added to Unity Assets/Plugins/Android folder
    Added implementation 'com.google.android.play:core:1.8.3' to dependencies block of gradle file(app module)
    after I read this reference https://developer.android.com/guide/playcore/in-app-updates

    2. Called Android-Java Function in Unity
    Called Update Checking method in plugin with AndroidJavaClass object in Unity.

    When I run my game I get this exception.
    exception.jpg

    Note that this logcat is not from live app but Is that matter with this exception??
    Other Library in aar works fine.Only google.android.play.core library matters. Have I missed something?
     
    Last edited: Mar 9, 2021
  2. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    Do you have the playcore.aar file in your Unity project?
     
    FlowORemi likes this.
  3. FlowORemi

    FlowORemi

    Joined:
    Apr 26, 2019
    Posts:
    7
    I finally made it.Thanks kaarloew. As you mentioned What I missed was play core library.

    To add play core library, download this package https://github.com/google/play-unity-plugins or insert this JSON statement to Packages/manifest.json, then download play core library from Unity's package manager.

    Code (JavaScript):
    1.  
    2. "scopedRegistries": [
    3.     {
    4.       "name": "Game Package Registry by Google",
    5.       "url": "https://unityregistry-pa.googleapis.com",
    6.       "scopes": [
    7.         "com.google"
    8.       ]
    9.     }
    10.   ]
    11.  
    https://stackoverflow.com/questions/56087064/how-can-i-test-in-app-updates-in-android
    In addition, I leave it for someone who is going through the same difficulties as me while testing the in app update.
    As rpattabi said, I took test process from google play store's in alpha track and It worked!