Everything was so, I connected the logIn button to Google and it worked fine.

Then I worked on the project and decided to start everything and check it out and that’s when I got to activation with authorization I flew with an error

java.lang.RuntimeException: Unable to start activity ComponentInfo {com.example.android.camera2basic / com.example.android.camera2basic.authorization.AuthorizationActivity}: java.lang.IllegalArgumentException: AppIndex: The URI host match the package request follow the format (android-app: //// [host_path]). Provided URI: android-app://com.example.android.camera2basic.authorization/http/host/path at com.google.android.gms.internal.zzju.zzb (Unknown Source) at com.google.android.gms .internal.zzju.zza (Unknown Source) at com.google.android.gms.internal.zzjt.zza (Unknown Source) at com.google.android.gms.internal.zzju.zza (Unknown Source) at com.google .android.gms.internal.zzju.start (Unknown Source) at com.example.android.camera2basic.authorization.AuthorizationActivity.onStart (AuthorizationActivity.java.7374)

Like nothing that concerned Google registration did not touch. According to the description of the error, the AppIndex format is incorrectly entered, but I cannot understand what it depends on, how to check how correctly? I did not change anything and it worked, but now it is not right ... Strange ...

Tell me what's wrong?

Here is the part of the code in which the error

 protected void onStart() { super.onStart(); // ATTENTION: This was auto-generated to implement the App Indexing API. // See https://g.co/AppIndexing/AndroidStudio for more information. client.connect(); mGoogleApiClient.connect(); // ATTENTION: This was auto-generated to implement the App Indexing API. // See https://g.co/AppIndexing/AndroidStudio for more information. Action viewAction = Action.newAction( Action.TYPE_VIEW, // TODO: choose an action type. "Authorization Page", // TODO: Define a title for the content shown. // TODO: If you have web page content that matches this app activity's content, // make sure this auto-generated web page URL is correct. // Otherwise, set the URL to null. Uri.parse("http://host/path"), // TODO: Make sure this auto-generated app URL is correct. Uri.parse("android-app://com.example.android.camera2basic.authorization/http/host/path") ); ---> AppIndex.AppIndexApi.start(client, viewAction); <--- } 
  • As a result, I deleted this line in which the error crashed and everything works ... I don’t understand why it was needed at all, as I did by example ... Strange ... But I deleted it and everything seems to work, let's see where else to fall off - Aleksey Timoshchenko

1 answer 1

Judging by the logs you are trying to issue a string

android-app://com.example.android.camera2basic.authorization/http/host/path

for a valid path, which, apparently, you should have

 android-app://com.example.android.camera2basic.authorization 

those. /http/host/path seems superfluous

  • nothing has changed ... I completed part of the question - Aleksey Timoshchenko
  • @AlekseyTimoshchenko, in your code it is not visible that you try to replace Uri.parse("http://host/path") with null and remove "/ http / host / path" from the last URI - YuriSPb
  • As a result, I deleted this line in which the error crashed and everything works ... I don’t understand why it was needed at all, as I did by example ... Strange ... But I deleted it and everything seems to work, let's see where else to fall off - Aleksey Timoshchenko
  • Write this in response - Yuriy SPb