Try   HackMD

Android Studio 複製專案,修改路徑位址

tags: Android Studio

以下範例:複製 marriagesuggestion > 為 marriagesuggestionCh8

複製檔案資料夾,之後重新命名為 marriagesuggestionCh8

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這三個資料夾內的資料夾名稱都要修改為 marriagesuggestionCh8
D:\Android\MarriageSuggestionCh8\app\src\androidTest\java\com\example\修改檔名
D:\Android\MarriageSuggestionCh8\app\src\main\java\com\example\修改檔名
D:\Android\MarriageSuggestionCh8\app\src\test\java\com\example\修改檔名

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

之後打開複製的檔案,裡面也有內容要改
applicationId 的路徑要改為 "com.example.marriagesuggestionCh8"

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

修改封包路徑,Java底下的檔案都要修改
package com.example.marriagesuggestionCh8;

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這個Java(generated)底下的資料夾、檔案內的路徑也要修改

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

D:\Android\MarriageSuggestionCh8\app\build\generated\source\buildConfig\debug\com\example\修改檔名

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

修改BuildConfig內的路徑

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

最後再按 build > clean project
Java(generated)好像會直接被清掉,所以好像這裡不用改路徑XD

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


如果專案小的話,也可以直接開新專案複製程式碼就可以哩^^