0

I have an onClickListener() for a Download button in the sole activity in my Instant App package. When clicked, it forms the postInstallIntent:

Intent postInstallIntent = new Intent(getApplicationContext(), Test.class);

When I Run instantapp, it crashes at this line with this Logcat entry:

    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/quixr/testqiew2/full/Test;

The activity Test is in the feature module full and is a Launcher:

<application>
    <activity android:name=".Test">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

The build.gradle for app contains a dependency on full:

implementation project(':full')

Should Test be somewhere else to be found? Or is there a different reason it is not being found?

Prags
  • 2,457
  • 2
  • 21
  • 38
JAW
  • 187
  • 2
  • 13
  • Does that activity definition show up in the installed module merged manifest? – dazza5000 Mar 26 '18 at 22:26
  • can you check this URL https://stackoverflow.com/questions/47603099/android-instant-app-showinstallprompts-postinstallintent-does-nothing might it help you – Prags Mar 27 '18 at 14:50
  • The Test activity appears in the MergedManifest for app and both of the feature apps, feature and full. It does not appear in the base MergedManifest. The sources for the merge include full, the feature module that includes the Test Activity, only for full and feature - NOT app or base. – JAW Mar 27 '18 at 16:35
  • I have seen stackoverflow.com/questions/47603099/. I am trying the various forms of Intent. – JAW Mar 27 '18 at 16:36
  • As Pragati mentioned, that intent should be made with a URI, you can see the official example @ https://github.com/googlesamples/android-instant-apps/blob/master/install-api/features/install/src/main/java/com/instantappsamples/feature/install/InstallApiActivity.kt – TWL Mar 27 '18 at 17:02
  • Thanks @Pragati-Singh. When I tested the alternatives in /questions/47603099, I found that the URI version worked: Uri uri = Uri.parse("https://www.example.com/hello/"); Intent postInstallIntent = new Intent("action", uri); showInstallPrompt returned true while there was a white message box saying "Item not found" which I would expect since the installed module is not yet on the Play Store – JAW Mar 27 '18 at 19:18

0 Answers0