インスタントアプリケーションを公開する準備が整いましたが、AIAアプリケーションをGoogle PlayのAIA開発トラックで実行しているときに問題が発生しています。
AndroidスタジオからAIAアプリが完全に動作しますが、この問題はPlayストアから実際の端末で実行しようとしたときに発生します。
ご協力いただければ幸いです。問題のSecurityException:アクティビティインテントを開始できません
エラー:
java.lang.SecurityException: Not allowed to start activity Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=https://www.example.com/... pkg=com.example (has extras) }
当社のAIAは非常にGoogleが提供するサンプルのように、アプリの他の機能に記載されている活動を開くこととしてACTION_VIEW
インテントを実行するように設定されています。
私たちのアプリがURL経由で開かれたとき、私たちのベース機能のルータアクティビティに送信され、URIの解析を処理し、URLパスを処理する適切なアクティビティを開きます。
- 基本機能 - UrlRouterActivity
- 特集1 - Feature1Activity
ベースフィーチャマニフェスト:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rentpath.lib">
<application>
<activity
android:name=".activity.UrlRouterActivity"
android:noHistory="true"
android:launchMode="singleInstance"
android:theme="@style/Theme.AppCompat.NoDisplay">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="www.example.com" />
<data android:pathPrefix="/path" />
</intent-filter>
</activity>
</application>
</manifest>
特集1つのマニフェスト:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rentpath.lib.pdp">
<application>
<activity
android:name=".activity.Feature1Activity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/filter_scheme_secure" /> <!-- String resource for https -->
<data android:host="www.example.com" />
<data android:pathPrefix="/action_feature_1" />
</intent-filter>
<intent-filter>
<action android:name="action_feature_1"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
当社のルータアクティビティタクES URI、URL paramsはを解体し、次のようにテントを構築します:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https:www.example.com/action_feature_1?some_param=some_value"));
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setPackage(context.getPackageName());
startActivity(intent);
上部に言及した例外で、この活動の成果を開始。
これも、Google Playの開発トラックからAIAアプリを実行している場合にのみ発生します。
AndroidスタジオからAIAアプリを実行しているときは発生しません。
追加情報:
Android Studio 3.0 Beta 2
Gradle plugin: 3.0.0-beta2
Gradle wrapper distribution: 4.1-rc-1
重複していません。また、私はすでにソリューションを追加しました。あなたは全体のポストを読んだことがありますか? – lgfz71
以下の質問に答えてください。質問の編集ではありません。 –
回答する担当者はいらない –