0

I have 2 projects. The one is an exact copy of the other. Lets call them Project A and Project A - Copy.

When I install and run both apps through Android Studio on a physical device, Project A - Copy works and Project A does not.

The difference seems to be in the run tab.

Project A (The app that does not work)

08/06 18:47:11: Launching app
$ adb push C:\Blessd\app\build\outputs\apk\app-release.apk        /data/local/tmp/mobi.app.user.app
$ adb shell pm install -r "/data/local/tmp/mobi.app.user.app"
pkg: /data/local/tmp/mobi.app.user.app
Success

$ adb shell am start -n "mobi.app.user.app/mobi.app.androidrtc.SplashActivity" >-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error: Activity class {mobi.app.user.app/mobi.app.androidrtc.SplashActivity}     does not exist.
Error while Launching activity

SplashActivity does however exist

Compared to Project A - Copy (The working one)

$ adb shell am start -n
"mobi.app.androidrtc/mobi.app.androidrtc.SplashActivity" -a    
android.intent.action.MAIN -c android.intent.category.LAUNCHER 

So the question is how do I change the portion "mobi.app.user.app" as that seems to be giving me the problem.

the_big_blackbox
  • 1,056
  • 2
  • 15
  • 35
  • 1
    Did you mention the activity in manifest? – Shunan Aug 06 '16 at 18:09
  • It seems like your package naming isn't correct. This could happen if you changed the package name after copying Project A. "mobi.app.user.app/mobi.app.androidrtc" and "mobi.app.androidrtc" – adhirajsinghchauhan Aug 06 '16 at 18:20
  • hi, yes it is in the manifest file.. the issue is as @asc42 suggested around the naming I just dont know how to fix it.. i am also not sure where it is picking up the user naming convention – the_big_blackbox Aug 06 '16 at 18:35

1 Answers1

1

This is a build path issue. You either have #2 as a required project on #1's build path, or you have #2 as a jar on #1's build path. The best solution would be to not use the same package across two projects. Choose a package name that differentiates the two projects.

More refer here: Android Studio Rename Package

Community
  • 1
  • 1
Fajar Khan
  • 952
  • 1
  • 12
  • 30
  • Hi thanks, Package name is the same in both instances in the manifest file. Splash screen activity package name in file and manifest is correct. I had previously used your link to rename the both projects in the same way.. – the_big_blackbox Aug 06 '16 at 18:49
  • This is a build path issue. You either have #2 as a required project on #1's build path, or you have #2 as a jar on #1's build path. The best solution would be to not use the same package across two projects. Choose a package name that differentiates the two projects. – Fajar Khan Aug 06 '16 at 18:56
  • sorry my pc and internet slow today... your solution in the comment field worked... change your answer to what you have in the comment field...thanks a lot – the_big_blackbox Aug 06 '16 at 21:07
  • @the_big_blackbox glad to know i helped you :) edited answer – Fajar Khan Aug 06 '16 at 21:34