简体   繁体   English

没有更新的 apk 文件,在 android studio 上运行的项目

[英]Not getting updated apk file, project running on android studio

How to clean a project in Android Studio?如何清理 Android Studio 中的项目? I have changed the project from Eclipse and my apk file is not updating, it contains the old apk file from Eclipse.我已经从 Eclipse 更改了项目,但我的 apk 文件没有更新,它包含来自 Eclipse 的旧 apk 文件。 I did rebuild project, doesn't help.我确实重建了项目,没有帮助。 Also checked Out folder, no apk for this project is there.还检查了 Out 文件夹,那里没有这个项目的 apk。 Also I changed my project name once while it was in Eclipse.我还在 Eclipse 中更改了我的项目名称一次。 Now the Out folder still contains the old projectname.apk file.现在 Out 文件夹仍然包含旧的 projectname.apk 文件。 Would really appreciate your help.非常感谢您的帮助。

当您认为 Android Studio(或 Intellij IDEA)没有接受外部所做的更改时,有时File -> Invalidate Caches...会有所帮助。

In my own case, deleting the existing/old apk in the output folder helped to resolve this issue.在我自己的情况下,删除输出文件夹中的现有/旧 apk 有助于解决此问题。 If you run into this problem, it might be worth trying the following sequence of steps:如果您遇到此问题,可能值得尝试以下步骤序列:

  • I opened my file manager and deleted the existing apk file.我打开了我的文件管理器并删除了现有的 apk 文件。
  • I opened Android studio and clicked on Build APK(s).我打开了 Android Studio 并点击了 Build APK(s)。

I had this problem before and this way helped me.我以前遇到过这个问题,这种方式对我有帮助。 You can run this at the root of your project您可以在项目的根目录下运行它

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

Then cd to android and run this然后cd到android并运行这个

./gradlew assembleDebug

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM