1

I lost the Google Play Keystore (of only Android Studio file browser put removed file into the Recycle Bin rather than removing them completely)... so I tried to upload the app as a new app. But first I must change the package names.

I search (find path) for all instances of the full package name, and replaced all with the new package name. I've also used Rebuild Project and Clear Project several times.

Issues that appeared now are:

Cannot resolve symbol 'R' 

And if I try to run or generate an APK, the following error is thrown:

Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Program Files\Android\sdk\build-tools\20.0.0\aapt.exe'' finished with non-zero exit value 1 

Every instance of old.package.name is changed to new.package.name, including folders (main/java/) and AndroidManifest.xml

If someone has experience this before and maybe have ideas to solve it.
I can also provide more information when needed.

1 Answer 1

1

This is because even though you have changed the package name, the package name in gen is still the old one. Just use an import statement in your class and import the old package name.R.

Sign up to request clarification or add additional context in comments.

3 Comments

Is it possible to change the name in gen?
If you clean the project entirely, the gen folder should automatically get created.
I've tried importing my old package name for R: import se.company.appname, but it says that my old name isn't available, and asks if I want to use the new. I've also tried to remove and rebuild the gen-folder (app\build\generated\ ), but still the same non-zero-error.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.