kamegami13 / MonsterHunter4UDatabase

MIT License
114 stars 41 forks source link

Changed project to Android Studio #1

Closed JoeLago closed 9 years ago

JoeLago commented 9 years ago

I haven't worked much with Android studio. It looks like it might be worth ignoring the *.iml files since gradle seems to generate them and they change depending on where you clone the app.

kamegami13 commented 9 years ago

I'm assuming you got this to compile. I'll attempt to test this tonight and merge it.

JoeLago commented 9 years ago

Yeah, you should be able to clone this fork, open and run it in Android Studio giving you the same application you got in Eclipse. Let me know if you have any issues.

All the eclipse metadata is gone and the entire ActionBar project was replaced with a gradle dependency so Android Studio will go download it instead of keeping it in version control.

kamegami13 commented 9 years ago

Not problem, I want to make sure I can compile to an APK then I'll merge.

kamegami13 commented 9 years ago

What version of Android Studio are you running? I'm using 1.02 and every time I attempt to open it I get

The project is using an unsupported version of Gradle. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)

Nothing I search for is being helpful.

armaghan-behlum commented 9 years ago

Using Android Studio 1.0.1 here and the project built successfully. Maybe try re-importing after deleting the *.iml files? Did you tell it to use the local gradle distribution or the gradle wrapper?

Also as a sanity check, what version of gradle do you have? I have 2.2.1

kamegami13 commented 9 years ago

I un-installed and re-installed Android Studio to be safe. Didn't work.

Use default gradle wrapper is grayed out with the message (not configured for the current project) Right now I'm telling it to use local gradle distribution in the plugins folder

I have no idea how to check my version. I tried checking the Plugins menu in AS but under Gradle it says Version: N/A

I tried getting rid of the *.iml files. Didn't do anything.

kamegami13 commented 9 years ago

As a sanity check I tried downloading JoeLago's git separately and open that project in case there was a merge error. Nope, same error.

armaghan-behlum commented 9 years ago

Yea it's N/A for me there as well. If using Mac or Linux, you should be able to do gradle -v in the terminal. If that doesn't work or you're on windows, go to File > Project Structure > Project. You should be able to see a Gradle version there. If it's not 2.2.1 then try to update. If it is, try doing the follow:

File > Invalidate Cache/Restart > Invalidate Cache and Restart.

That should force a rebuild and maybe fix the problem.

If none of those above work, try deleting the *.iml file again and try an import, but instead of selecting to import the project directory, select the build.gradle file in the root of the project. Both methods lead to a successful project import for me, but the second allowed me to use the default gradle wrapper option (which was grayed out as yours was).

JoeLago commented 9 years ago

I'm using Android Studio 1.0.1 on both Windows 7 and OS X Yosemite and was able to run a fresh clone on each.

After a fresh clone:

Let me know if those steps work for you. I will see if I can set up the project so the process is not so obtuse.

JoeLago commented 9 years ago

It looks like it's even more straightforward if you use Android Studios "Check out project from Version Control" option. Just choose git, plug in the url and keep hitting confirm to get the project going.

armaghan-behlum commented 9 years ago

I would recommend adding *.iml to the .gitignore in the check-in. Loading the project causes some of them to change for me and I believe that would be the case on a person to person basis. We wouldn't want that muddying up the commits.

armaghan-behlum commented 9 years ago

Imported the project with the new commits. Build ran successfully and app installed perfectly on a Nexus 5. Also in good news, git reported no modified files after doing the build, so everything looks really good!

ghost commented 9 years ago

I've still got a bunch of red J icons over every class file and am unable to go to class declarations by control clicking. Running version 1.0.2

kamegami13 commented 9 years ago

I was able to load JoeLago's repository, but my repository merged with JoeLago's changes refuses to work. Those that got it to work, did you merge the pull or grab his repository? I'm tempted to just auto-merge and then blow away my local repository but I want to confirm that there isn't a merge issue I'm encountering that will affect other.

armaghan-behlum commented 9 years ago

I got it to work by deleting the old local copy of his repo and grabbing his repo. So basically, putting the following link through the 'Import from Version Control' option and selecting git: https://github.com/JoeLago/MonsterHunter4UDatabase.git

kamegami13 commented 9 years ago

That's not encouraging. It indicates the issue is the merge and it'll break the repository. Can anyone else attempt a local merge of my repository and see if they can get it run?

On Fri, Jan 23, 2015 at 8:53 AM, Armaghan Behlum notifications@github.com wrote:

I got it to work by deleting the old local copy of his repo and grabbing his repo. So basically, putting the following link through the 'Import from Version Control' option and selecting git: https://github.com/JoeLago/MonsterHunter4UDatabase.git

— Reply to this email directly or view it on GitHub https://github.com/kamegami13/MonsterHunter4UDatabase/pull/1#issuecomment-71203993 .

armaghan-behlum commented 9 years ago

How is cloning your repo and merging his changes going to be different from just cloning his repo? The final directory in the end would be indistinguishable, no? Are you sure there's no local git based issues on your end? What error messages are you seeing?

armaghan-behlum commented 9 years ago

For a sanity check, I did as you said. Cloned the original repo, fetched the pull request, merged in the pull request, and then imported the project into Android Studio. For the importing method, I used the method Joe and I outlined involving the build.gradle file. Build ran successfully and app seems to work well.

kamegami13 commented 9 years ago

How is cloning your repo and merging his changes going to be different from just cloning his repo?

If there was a bad merge, but since you were able to get it working that way I'll blow away my work area and start over.

kamegami13 commented 9 years ago

Alright, I finally managed to get it imported and running on my phone! I'm merging the pull now.