Bug 59037 (vs-549719) - Error type 3: Activity class does not exist.
Summary: Error type 3: Activity class does not exist.
Status: RESOLVED FIXED
Alias: vs-549719
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in (show other bugs)
Version: 7.2 (d15-4)
Hardware: PC Mac OS
: High critical
Target Milestone: 15.6
Assignee: Cody Russell
URL:
Depends on:
Blocks:
 
Reported: 2017-08-25 11:41 UTC by jzeferino
Modified: 2018-01-17 17:50 UTC (History)
10 users (show)

See Also:
Tags: vs-sync
Is this bug a regression?: ---
Last known good build:


Attachments

Description jzeferino 2017-08-25 11:41:51 UTC
The problem is:

1 - Connect two devices via usb at the same time to the computer (Device1, Device2).
2 - Build and deploy the application to Device1.
3 - Select Device2 and press "play" again.

It copies the .apk to the Device2 but the following error is logged in Application output.

Forwarding debugger port 8851
Detecting existing process
> am start -n "pt.x.x/x.droid.activity.SplashActivity"
> Starting: Intent { cmp=pt.x.x/x.droid.activity.SplashActivity }
Error type 3
Error: Activity class {pt.x.x/x.droid.activity.SplashActivity} does not exist.

This is my settings:

=== Visual Studio Enterprise 2017 for Mac ===

Version 7.1 (build 1297)
Installation UUID: 4126a675-f1d9-404c-a489-ee603e8ba19b
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	1.1.1
	1.0.4
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
SDK Version: 1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/4.8.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 7.4.0.21 (Visual Studio Enterprise)
Android SDK: /Users/zeferino/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.2   (API level 17)
		4.4   (API level 19)
		5.1   (API level 22)
		6.0   (API level 23)
		7.0   (API level 24)
		7.1   (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.Mac ===

Version: 3.6.0.19 (Visual Studio Enterprise)

=== Xamarin.iOS ===

Version: 10.12.0.20 (Visual Studio Enterprise)
Hash: 80b8487d
Branch: d15-3
Build date: 2017-08-18 16:07:26-0400

=== Build Information ===

Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Comment 1 jzeferino 2017-08-25 14:52:40 UTC
This is the report event when the app is already installed in Device2 and I press "play" on the IDE:

Forwarding debugger port 8864
Detecting existing process
Terminated existing process> am start -n "pt.x.x/x.droid.activity.SplashActivity"
> Starting: Intent { cmp=pt.x.x/x.droid.activity.SplashActivity }
Error type 3
Error: Activity class {pt.x.x/x.droid.activity.SplashActivity} does not exist.
Comment 2 Jon Douglas [MSFT] 2017-08-28 17:37:48 UTC
Hi jzefernio!

I'm not able to reproduce this issue with the provided steps on a File -> New Xamarin.Android Project.

My best guess is that you have an old build on one of these devices and the respective build is not updating which it then does not see the SplashActivity. Can you please ensure you fully uninstall the application from each device and see if you can reproduce it?

Also, if you have a reproduction project that you can upload to this bugzilla report, it would be much appreciated!

Tested on VS4Mac 7.1 and 7.2. If we can reproduce this issue, we will want to try it on VS 2017. If we cannot replicate it there, we will reassign this bug to the VS4Mac team.

Thank you!
Comment 3 jzeferino 2017-08-29 15:23:39 UTC
Hello there Jon.

Here is a video and sample project.

https://drive.google.com/open?id=0B50BdYyRUBAJVE81aERwS2pxUjQ
Comment 4 jzeferino 2017-08-29 17:21:37 UTC
For some strange reasons the url is pointing to another folder.
Use this instead: https://drive.google.com/open?id=0B50BdYyRUBAJS1l1Rk8tRnEwZ1E
Comment 5 Jon Douglas [MSFT] 2017-10-04 16:52:25 UTC
(In reply to jzeferino from comment #4)
> For some strange reasons the url is pointing to another folder.
> Use this instead:
> https://drive.google.com/open?id=0B50BdYyRUBAJS1l1Rk8tRnEwZ1E

Was this issue resolved when we had our chat in Slack? I am not able to reproduce this issue on two separate devices that are connected to "adb devices".
Comment 6 jzeferino 2017-10-06 16:36:27 UTC
This is note resolved after our chat in Slack.

So, I will try to explain it with more details and steps.

Setup:

Have two devices (happens more in real devices) or emulators without the reproducible app installed.

Open and Clean the reproducible .sln I send with Visual Studio for Mac.

Reproduce.

1. Connect one phone/emulator in the computer (osx in my case).
2. Press "play" in the Visual Studio for Mac, that will build and deploy the app for the device.
3. Plug another device and press "Play" again.
4. You should see the error.

Watch the video for more detail.
Comment 7 nicolas.esprit.bdl 2017-10-11 08:00:14 UTC
I reproduce this problem, but with a simple Droid simulator : 

Forwarding debugger port 8854
Detecting existing process
> am start -n « XX/ZZ.SplashActivity"
> Starting: Intent { cmp=xx/zz.SplashActivity }
Error type 3
Error: Activity class {xx/zz.SplashActivity} does not exist.

Restart Simu, restart VS for Mac, or clean project doesn't resolve.

But after obliterate (bin and obj folders), it's work.

Not the first time i see this error. It's frustrating.
Comment 8 jzeferino 2017-10-11 14:05:06 UTC
I can confim that this is solved after a clean, but it don't make any sense. sometimes we need to deploy the same build to multiple devices and it should't be necessary to re-build the package.
Comment 9 Jon Douglas [MSFT] 2017-10-25 03:39:16 UTC
I was able to CONFIRM this issue one night after using Visual Studio for Mac. Here's how I reproduced it:

1. Debug a Xamarin.Android application on an emulator of your choice.
2. While debugging is still active, uninstall the Application from the device
3. The IDE will then terminate the debugger connection
4. Try to deploy the Xamarin.Android application again and you'll see the following issue in Application Output:

> am start -n "com.douglas.mayday/md59eeb10a61623d62b9de7fa6d620ac0a0.IntroductionActivity"
> Starting: Intent { cmp=com.douglas.mayday/md59eeb10a61623d62b9de7fa6d620ac0a0.IntroductionActivity }
Error type 3
Error: Activity class {com.douglas.mayday/md59eeb10a61623d62b9de7fa6d620ac0a0.IntroductionActivity} does not exist.

This is reproducible with a File->New Xamarin.Android Project on:

Visual Studio for Mac 7.2 (build 636)
Xamarin.Android 8.0.0.33

I am setting the priority to high due to the nature of a deployment experience. I am also rerouting this bug to Visual Studio for Mac as this only occurs on Mac and not Visual Studio 2017 on Windows.
Comment 10 jzeferino 2017-10-25 10:06:48 UTC
Thats correct Jon. Thank you.
Comment 11 Tom Opgenorth 2017-12-05 14:07:06 UTC
I'm experiencing the same error, but with some slight deviation from Jon's repro steps:

1. Debug an Xamarin.Android application on an Android device (Nexus 5 w/Android 6.0) using Visual Studio for Mac (details about my installation below). In my case I'm using the RecordAudio recipe at https://github.com/xamarin/recipes/tree/master/android/media/audio/record_audio.
2. Stop the application, and uninstall it from the device.
3. Try to debug the application again. 
4. Output similar to the following will be seen in the Application Output pad:

    Forwarding debugger port 8885
    Detecting existing process
    > am start -n "RecordAudio.RecordAudio/md579d1fe11848eea3b8f5ca2cf75e6c947.Activity1"
    > Starting: Intent { cmp=RecordAudio.RecordAudio/md579d1fe11848eea3b8f5ca2cf75e6c947.Activity1 }
    Error type 3

Of interest: 
* Visual Studio for Mac will not provide any kind of indication that the app failed to deploy. The app is not installed on the device.




Information about VS4M:

=== Visual Studio Enterprise 2017 for Mac ===

Version 7.2.2 (build 11)
Installation UUID: ef2cd217-c6d2-4b3a-8525-cd01cc0c9e21
Runtime:
	Mono 5.4.1.6 (2017-06/1f4613aa1ac) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010006

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.0.0
	1.1.2
	1.0.5
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Versions:
	2.0.0
	1.0.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.6
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 8.0.2.1 (Visual Studio Enterprise)
Android SDK: /Users/tom/Library/Android/sdk
	Supported Android versions:
		4.0.3 (API level 15)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)
		7.0   (API level 24)
		7.1   (API level 25)
		8.0   (API level 26)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 26.0.2
SDK Build Tools Version: 27.0.1

Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

=== Apple Developer Tools ===

Xcode 9.1 (13532)
Build 9B55

=== Xamarin.Mac ===

Version: 3.8.1.0 (Visual Studio Enterprise)

=== Xamarin.iOS ===

Version: 11.3.0.47 (Visual Studio Enterprise)
Hash: 51128b8c
Branch: xcode9.1
Build date: 2017-10-31 22:42:13-0400

=== Build Information ===

Release ID: 702020011
Git revision: b604c37c5a4a2f0919b45ffbe2aaad9fe040af31
Build date: 2017-11-01 08:31:43-04
Xamarin addins: d57dc14cbd4eb166ee62bab585965ab78d3650bc
Build lane: monodevelop-lion-d15-4

=== Operating System ===

Mac OS X 10.13.1
Darwin 17.2.0 Darwin Kernel Version 17.2.0
    Fri Sep 29 18:27:05 PDT 2017
    root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Internet of Things (IoT) development (Preview) 7.1
Comment 12 Marcos Cobeña Morián 2017-12-15 11:31:35 UTC
Hi,

I was looking for anyone reporting this issue and exactly experience the same scenario as Tom's.

I remember this to happen from long time ago, and have always done the same workaround:

Add any white space wherever in the source code and VS will be forced to rebuild its project thus ends running the app correctly.

If can provide any sort of info to help this be solved please let me know. It's one small thing which could make smoother our experience with VS and Android.

Thanks in advance!

Marcos
Comment 13 Cody Russell 2018-01-17 17:50:33 UTC
In VSMac 7.3.3 (build 5) there was a fix for another similar issue. When using that build I can no longer reproduce this bug, so I think the two had the same root.

Given that, I'm going to close this bug. But if I'm wrong for some reason please feel free to re-open.

Note You need to log in before you can comment on or make changes to this bug.