I have one project in android studio,
I have first exported project from eclipse to android studio.
After that
I have changed its package name in AndroidMenifest.xml,
rename directories from Android Studio,
Changes Package name in all my class files
,
also changed position of R.java
file
And gen
folder like old was com.oldpath.path1
to com.newpath.path2
.
Also reflect same in R.java file and BuildConfig.java file.
Now getting Error as follow..
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.oldpath.path1/com.newpath.path2.main.SplashScreen }
Error type 3
Error: Activity class {com.oldpath.path1/com.newpath.path2.main.SplashScreen} does not exist.
Please help me I am stuck in my project..
Using Android Studio 3.0.1, it is not enough to just refactor the name of your package using the Refactor -> Rename...
tool. First, as noted, this misses several references throughout your project, including within your Manifest file(s). Second, this misses generated-files and Android Studio cache (leading to the error identified by the OP).
For anyone stumbling on this, if you have not already renamed your package then follow these steps to do so: Rename package in Android Studio
Otherwise, if you've already tried and failed then the following steps will rescue your project:
Solution in Android Studio
Ctrl+Shift+F
to find and replace any references to your old package name that were missed by the refactor tool.Build -> Clean Project
. This will regenerate your R file, fixing the last related build error, but giving you the startup error noted by the OP. Unfortunately, if you still have build errors then you're not quite facing the same issue as the OP...File -> Invalidate Caches / Restart...
That's it! Android Studio will synchronize your Gradle file upon restarting, and from now on it will reference your new package name when starting your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With