Rajawali / RajawaliVuforia

Rajawali + Vuforia Augmented Reality
Other
227 stars 108 forks source link

How to Build the project in Android Studio? #47

Closed nileshlg2003 closed 9 years ago

nileshlg2003 commented 9 years ago

Recently I moved to Android studio from Eclipse So am not good with it. Can some one please guide me on how to build Rajawali vuforia project on Android studio? Here's what I tried till now, 1) Cloned the project 2) run gradle.bat with "clean assembleRelease uploadArchives" from command prompt. 3) I get the following error ' FAILURE: Build failed with an exception.

What went wrong: A problem occurred configuring project ':rajawalivuforia'.

SDK location not found. Define location with sdk.dir in the local.properties f ile or with an ANDROID_HOME environment variable. '

4) I checked the android sdk path in sdk.dir which is correct sdk.dir=C:\Users\Nilesh\AppData\Local\Android\sdk

I don't know what to do now. Shall I import the project directly in to Android studio as gradle project? but in that case it shows error gradle version is not supported

MasDennis commented 9 years ago

Do you still have this problem? Please reopen if this is still an issue.

nileshlg2003 commented 9 years ago

I still couldn't build the project.

> Could not resolve org.rajawali3d:rajawali:1.0.261-SNAPSHOT.
     Required by:
         org.rajawali3d.vuforia:rajawalivuforia:1.0.0-SNAPSHOT
      > Unable to load Maven meta-data from https://jcenter.bintray.com/org/rajawali3d/rajawali/1.0.261-SNAPSHOT/maven-metadata.xml.
         > Could not GET 'https://jcenter.bintray.com/org/rajawali3d/rajawali/1.0.261-SNAPSHOT/maven-metadata.xml'.
            > jcenter.bintray.com
      > Unable to load Maven meta-data from https://oss.sonatype.org/content/repositories/snapshots/org/rajawali3d/rajawali/1.0.261-SNAPSHOT/maven-metadata.xml.
         > Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/org/rajawali3d/rajawali/1.0.261-SNAPSHOT/maven-metadata.xml'.
            > oss.sonatype.org

I tried solutions provided in other posts like,un-commenting maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } it was already un-commented.

MasDennis commented 9 years ago

Hi Nilesh, The sonatype url shouldn't be uncommented. Did you get the latest version from Github?

nileshlg2003 commented 9 years ago

yes I I got the latest one, and Sonatype url wasnt commneted by default and I didnt change it. However I was able to build the project after gradle synch.

Now what Next? If I want to run Example project Do i have to import it separately in Android studio? and it will automatically link it up? or Do I have to import the example in rajawalivuforia project in order to run it?

I am sorry for really stupid question :(

nileshlg2003 commented 9 years ago

I Imported RajawaliVuforiaExample in android studio,

I get this error upon gradle build

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/qualcomm/QCAR/BuildConfig;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_10\bin\java.exe'' finished with non-zero exit value 2
MasDennis commented 9 years ago

Did you do a clean before build?

nileshlg2003 commented 9 years ago

yes, I did clean it. it builds successfully. but when I run the application from AS, I get above error What does this line mean? Multiple dex files define Lcom/qualcomm/QCAR/BuildConfig;

I remember once I got similar error because of declaring multiple support library dependency in build.gradle (module)

rkoshti commented 5 years ago

@MasDennis @nileshlg2003 It's not working for me as well.

I am using latest android studio and i have followed all the steps which written above for stacktrace but still unable to build the project

2019-05-20_1445

Kindly help