Closed YeeSuannn closed 10 years ago
I'll see what's the problem tomorrow. What is the target Android version?
The target Android version is 19. Min Sdk version is 14.
Just to make sure. Are you using maven or gradle as build system? Or did you just added the single jar as dependency to your project in eclipse?
I experience same problem.
By the way before using jar I tried in my build.gradle:
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile ("net.glxn.qrgen:android:2.0-SNAPSHPOT")
}
But get: Error:Failed to find: net.glxn.qrgen:android:2.0-SNAPSHPOT
Then I tried jars. I added android-2.0-20140713.143342-8.jar and core-2.0-20140713.143320-9.jar in libs with this build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
After syncing I get the error mentionned above. From my understanding (I just begin with gradle and maven repo), because I provided myself QRGen I have to provide the dependencies too (zxing).
@gmarizy Sorry there was a typo in the readme. It is net.glxn.qrgen:android:2.0-SNAPSHOT
and not SNAPSHPOT
this may help in your case. I've also setup a small sample application.
@CelestialMilky In case you are trying to setup all dependencies without maven or gradle you need to add at least the core
from QRGen
and zxing
core artifact, otherwise required classes can't be found.
Thank you ! The sample is an helpful addition.
Yes, i setup all the dependencies. i added core and android from QRGen and core from zxing. Then i got this error "java.lang.NoClassDefFoundError: com.google.zxing.qrcode.QRCodeWriter." Im trying to use gradle. quite new to me >.<
Is this issue resolved then?
Den 17. aug. 2014 kl. 15:13 skrev gmarizy notifications@github.com:
Thank you ! The sample is an helpful addition.
— Reply to this email directly or view it on GitHub.
Can i just use the dependencies instead of gradle or maven?
It should be possible. Are you using eclipse or android studio? But I would highly recommend to get familiar with gradle as it is (resp. will become) the new standard build system for android applications.
I'll try to figure out what jars you exactly require as dependencies.
I'm using eclipse. Okayy, i will try to understand on how to use gradle and maven since i have been seeing quite a number of people been mentioning it as well.
Thank you for trying to help me figure out what jars i need :)
Just try downlowding android studio and create a new project, it will setup all required gradle files as required for you.
Edit: It should be sufficient to add these jars to your eclipse project:
At least these are the only ones required.
Will it affect my partner? cos currently both of us are using eclipse. if i started to use android studio and my partner continue to use eclipse, will it affect the compilation in the end?
Yes. You must convert your eclipse android project to a gradle project (function provided by the android development tools). But just try adding the three jars mentioned before, it should work.
Is it possible if i stick with eclipse android and use gradle ?
not sure. Eclipse supports gradle via an external plugin very well, but I don't know how it works with the android development tools for eclipse. So I suggest either switch to android studio + gradle or stick with eclipse and eclipse tooling for now.
I would love to stick with eclipse and eclipse tooling for now.. Sorry for being stubborn. It is still possible to do QRGen without using gradle or maven,right?
Yes definitely possible.
Glad to hear this. thank you! :)
Closing this issue, as it is not a bug.
Yes not a bug.
@CelestialMilky for your information: I've setup a new android project in eclipse and put all three jars into the libs folder. They are automatically added to the build path and creating the qrcode works as expected.
Okay. thank you so much !
I tried it in a new android project but it doesnt work.
What version of android development tools are you using? The libraries must be part of the build path (see attached screenshot)
I solved the problem already. It is working now !! :))
Hi. I imported android-2.0-20140713.143342-8.jar to my project from "https://oss.sonatype.org/content/repositories/snapshots/net/glxn/qrgen/android/2.0-SNAPSHOT/" and then according to your README.md usage, i wrote this code on my activity: File file = QRCode.from("Hello World").file(); // override the image type to be JPG QRCode.from("Hello World").to(ImageType.JPG).file(); QRCode.from("Hello World").file("QRCode");
However, it crashed the application. the logcat stated that "java.lang.NoClassDefFoundError: com.google.zxing.qrcode.QRCodeWriter." May i know how should i solve this?