Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: all buttons in the sample of Kotlin&v3 cause a crash #118

Closed
AndroidDeveloperLB opened this issue Oct 19, 2020 · 15 comments · Fixed by #452 or #457
Closed

Bug: all buttons in the sample of Kotlin&v3 cause a crash #118

AndroidDeveloperLB opened this issue Oct 19, 2020 · 15 comments · Fixed by #452 or #457
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Oct 19, 2020

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ...")
    v3

  2. OS type and version
    Emulator API 30

  3. Library version and other environment information
    // GMS
    gmsImplementation 'com.google.android.libraries.places:places:2.4.0'

    // V3
    v3Implementation name:'places-maps-sdk-3.1.0-beta', ext:'aar'
    v3Implementation 'com.android.volley:volley:1.1.1'
    v3Implementation 'com.google.android.gms:play-services-base:17.4.0'
    v3Implementation 'com.google.android.gms:play-services-basement:17.4.0'
    v3Implementation 'com.google.android.gms:play-services-gcm:17.0.0'
    v3Implementation 'com.google.android.gms:play-services-location:17.1.0'
    v3Implementation 'com.google.android.gms:play-services-tasks:17.2.0'
    v3Implementation 'com.google.android.libraries.maps:maps:3.1.0-beta'
    v3Implementation 'com.google.auto.value:auto-value-annotations:1.7.4'
    v3Implementation 'com.google.code.gson:gson:2.8.6'

Steps to reproduce

  1. Import attached, which is based on the demo here:

https://github.com/googlemaps/android-places-demos/tree/main/demo-kotlin

Code example

It's just what's on the sample.

Stack trace

2020-10-19 10:43:01.502 32526-32526/com.example.placesdemo.v3 E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.placesdemo.v3, PID: 32526
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/datatransport/runtime/TransportRuntime;
        at com.google.android.libraries.places.internal.fg.<init>(PG:5)
        at com.google.android.libraries.places.internal.cb.h(PG:17)
        at com.google.android.libraries.places.internal.cb.i(PG:18)
        at com.google.android.libraries.places.internal.cb.l(PG:21)
        at com.google.android.libraries.places.internal.cb.r(PG:27)
        at com.google.android.libraries.places.internal.cb.a(PG:1)
        at com.google.android.libraries.places.api.Places.a(PG:43)
        at com.google.android.libraries.places.api.Places.createClient(PG:30)
        at com.example.placesdemo.CurrentPlaceTestActivity.onCreate(CurrentPlaceTestActivity.kt:62)
        at android.app.Activity.performCreate(Activity.java:8000)
        at android.app.Activity.performCreate(Activity.java:7984)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.datatransport.runtime.TransportRuntime" on path: DexPathList[[zip file "/data/app/~~4e9kwdXxgvYn4L0pRpwLiA==/com.example.placesdemo.v3-SLNdZABmDyGjIHSjoIMU4w==/base.apk"],nativeLibraryDirectories=[/data/app/~~4e9kwdXxgvYn4L0pRpwLiA==/com.example.placesdemo.v3-SLNdZABmDyGjIHSjoIMU4w==/lib/x86, /data/app/~~4e9kwdXxgvYn4L0pRpwLiA==/com.example.placesdemo.v3-SLNdZABmDyGjIHSjoIMU4w==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]

Following these steps will guarantee the quickest resolution possible.

I've tried each of the buttons. All cause a crash.

See attached:

https://github.com/kataklisma/android-google-places/files/5399937/2020-10-19_10-42-11.zip

And the project (without the real key):

https://github.com/kataklisma/android-google-places/files/5399948/demo-kotlin.zip

@AndroidDeveloperLB AndroidDeveloperLB added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 19, 2020
@kikoso kikoso self-assigned this Nov 28, 2022
@kikoso
Copy link
Collaborator

kikoso commented Nov 28, 2022

Hi @AndroidDeveloperLB .

The sample code has differed since you open this request.

Could you check that it is working? The issue seems to have been fixed in the meantime.

@kikoso kikoso closed this as completed Nov 28, 2022
@AndroidDeveloperLB
Copy link
Author

@kikoso Now it doesn't crash.
I added a key, and it worked fine.
However, I've noticed it doesn't request for permissions for places that it needs them.
Also I don't get why the need to present the weird coloring options on the main screen.

@kikoso
Copy link
Collaborator

kikoso commented Nov 30, 2022

@AndroidDeveloperLB , can you specify where the permissions are not being asked, and where are the weird coloring options?

@AndroidDeveloperLB
Copy link
Author

@kikoso

  1. At least in the last part there is no permissions request, when you open it. It needs location permissions.
  2. As for the colors, you see it right away when you open the sample.

Here, screenshot for both, with the number I've shown for each :

image

@wangela
Copy link
Collaborator

wangela commented Dec 12, 2022

Also of note, v3 of the Maps SDK for Android is deprecated as of August 2021 and soon to be decommissioned. #452 adds permission handling to the main version of this demo app, but we will not be updating the v3 version.

@wangela wangela added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed triage me I really want to be triaged. labels Dec 12, 2022
@AndroidDeveloperLB
Copy link
Author

@wangela Can you please show the old vs new dependency on gradle?
I want to see if what you are talking about is used in any of the projects I work on.

I have these on one of the projects I work on:

implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.maps:google-maps-services:2.1.2'

@kikoso
Copy link
Collaborator

kikoso commented Dec 13, 2022

@AndroidDeveloperLB , the dependencies seem correct. What @wangela is mentioning is that the v3 of the Maps SDK (which you seem to be using according to the crash log, com.example.placesdemo.v3) is deprecated.

Could you check out with the standard Maps SDK version?

@AndroidDeveloperLB
Copy link
Author

@kikoso What do you mean? What should I look for in the gradle file? What is the dependency, if it's not what I wrote? He mentioned v3 .

@kikoso
Copy link
Collaborator

kikoso commented Dec 13, 2022

@AndroidDeveloperLB , check out the project structure. You seem to be using the v3, which is deprecated. It is recommended to switch to the standard package.

Screenshot 2022-12-13 175840

@AndroidDeveloperLB
Copy link
Author

@kikoso I didn't post a project for a long time here.
Again, if the dependencies I've mentioned are being used, is it ok?
I'm talking about this:

#118 (comment)

Which dependencies should I search for, to make sure they are on the newest version? Where do you see on the dependencies I've mentioned that it's v3 or anything else?
BTW, he wrote we should switch to v3. Not the opposite.

@kikoso
Copy link
Collaborator

kikoso commented Dec 13, 2022

@AndroidDeveloperLB, the versions you are using for your project are good to go.

implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.maps:google-maps-services:2.1.2'

The reference to the v3 of the Maps SDK was based on your original crash report.

@AndroidDeveloperLB
Copy link
Author

@kikoso Are you talking about my first one post of this thread, on 2020 ?

@wangela
Copy link
Collaborator

wangela commented Dec 16, 2022

Yes, and the title of this issue also mentions "v3" which is why we thought the issue you are reporting is related to usage of the v3 folder of this demo repo. If that is not the case, please edit the title of the issue.

@AndroidDeveloperLB
Copy link
Author

@wangela The original issue existed, and was fixed. Now the new issue is this one:
#118 (comment)

I will close the current thread. Please create a new one with the information I've given .

@kikoso
Copy link
Collaborator

kikoso commented Dec 16, 2022

@AndroidDeveloperLB , there are a couple of PRs fixing the issues you mentioned, they will get merged soon but just FYI:

#452

#456

@kikoso kikoso mentioned this issue Dec 18, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
4 participants