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?
Related
i'm trying to running a test lab in firebase for my TV application, made with Leanback api and i have the following error message: "The uploaded APK does not specify a main launcher activity."
The application manifest does specify a LEANBACK_LAUNCHER intent-filter and the application is published on the play store and it works fine.
Anyone have any suggestions about it?
Thank you so much
<activity
android:name=".SplashActivity"
android:label="#string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
How can I launch an Activity from another Application Module within the same project?
I am not talking about how to open an Activity from another application, therefore this is not a duplicate of Launch an application from another application on Android
I have 2 modules: mobile and tv. Both are com.android.application on their build.gradle files and both are on the same package com.example.myapp.
I want the tv module to launch the MainActivity of the mobile module.
I've added the following line to my build.gradle(tv) file:
compile project(path: ':mobile')
on MainTvActivity.java I tried to reference the MainActivity
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
which didn't work, because it couldn't resolve the symbol MainActivity. It won't even build.
The other attempt was to use intent filters:
on AndroidManifest.xml(mobile)
<activity
android:name="com.example.myapp.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.example.myapp.mobile" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
on MainTvActivity.java:
Intent intent = new Intent("com.example.myapp.mobile");
startActivity(intent);
which will build and install but will crash because it won't find anything to resolve the intent. However, if I install the mobile version and then run the tv one, it will work (as expected).
I created a splash screen for my android application. In my AndroidManifest I set the SplashScreen Activity as Launcher and action as MAIN. After that I changed the HomeActivity's intentfilter.
Here is my android manifest file:
<application
android:allowBackup="true"
android:icon="#mipmap/icon"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SplashScreenActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivityHome"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.ACTIVITHOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name=".Receivers.NetworkReceiver"></receiver>
</application>
I have both these activities inside the default package. Now, when I try to test the application in device, I get the following error:
Error while executing: am start -n "com.sdz.myapp/com.sdz.myapp.SplashScreenActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sdz.myapp/.SplashScreenActivity }
Error type 3
Error: Activity class {com.sdz.myapp/com.sdz.myapp.SplashScreenActivity} does not exist.
Error while Launching activity
This is how my project structure looks like:
src
-com.sdz.myapp
----ActivityHome
----SplashScreenActivity
I restarted android studio but still the error is there. I dont know what is causing this.
I ran into this as well. I actually had to uninstall the apk from the device before it would work... which was really odd as the app wasn't showing up on my list of apps on the phone.
Here's what I did:
Opened up command line
Ran 'adb devices' to make sure my device was connected
ran 'adb uninstall ' Replace with "com.whatever.blah"
You should see a message saying it uninstall successfully
Try installing from Android Studio again and it should work
I have no idea how it gets in this weird state. :-/
Please change your android:name value at your activity tag with full name and first clean project . After that try to run your application again
<activity android:name="com.sdz.myapp.SplashScreenActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I have this same issue occasionally. The solution was to build the APK (menu "Build > Build APK") and install it manually in the phone. After that the error disappears.
I tried all of the above plus even delete the build folder and still did not work. The solution for me was: On your Android Studio go to File->Sync Project with Gradle Files
Normally when I run or debugg my application, it unistalls the old version, installs new version and finally it runs the new application, same process when I debug. Some days ago my eclipse started to work in a different way, it installs my application but it does not get ran. Before intalling I get this LogCat:
No Launcher activity found!
The launch will only sync the application package on the device!
Here my Manifest:
<activity
android:name="com.company.app.activities.WelcomeActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Can anybody help me with this? If I want to run the applications it's not a problem because I just have to do it manually but I can not debug.
Remove the follwing line from your manifest and try ,
<action android:name="android.intent.action.VIEW" />
I'm trying to run sample for Sony site.
I attached SmartExtensionAPI and SmartExtensionUtils. I used Properties->Android->Library and checked is library.
When I ran a sample (for example HelloWidget) on Eclipse, I get this error on the console:
HelloWidget] No Launcher activity found!
HelloWidget] The launch will only sync the application package on the device!
But the installation is done... I can see the application is installed on my smartphone and I can see too on SmartConnect but not in the smartwatch.
Does anyone have an idea of what I'm doing wrong ?
EDIT:
AndroidManifest.xml
<activity android:name="com.example.sonymobile.smartextension.hellowidget.HelloWidgetPreferenceActivity"
android:label="#string/preference_activity_title" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This is because no activity had set as a launcher to run when app is launched
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
no intent filter will be there in the code's manifest, just check it.