I made a java Library module in Android studio, and there is no problem with Compile, but there is a problem when running;; It's been a few days since Googleing, but I haven't solved it yet ㅠ 구 The result of Googleing is that I couldn't find the jar file at runtime; I don't know even if I listen to it
-------------android gradle---------------------
apply plugin: 'java-library'
repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() }
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.igniterealtime.smack:smack-java7:4.2.3'
compile 'org.igniterealtime.smack:smack-core:4.2.3'
compile 'org.igniterealtime.smack:smack-tcp:4.2.3'
compile 'org.igniterealtime.smack:smack-im:4.2.3'
compile 'org.igniterealtime.smack:smack-extensions:4.2.3'
compile 'xpp3:xpp3:1.1.3.3'
}
--------------- Results from the cmd window.----------------
C:\Users\T\AndroidStudioProjects\MyApplicationnn\Server\src\main\java\com\example\ Server>javac EntryPoint.java EntryPoint.java:3: error: package org.jivesoftware.smack does not exist import org.jivesoftware.smack.SmackException; ^ EntryPoint.java:4: error: package org.jivesoftware.smack does not exist import org.jivesoftware.smack.XMPPException;
^
EntryPoint.java:19: error: cannot find symbol public static void main(String[] args) throws IOException, SmackException{
^
symbol: class SmackException location: class EntryPoint EntryPoint.java:24: error: cannot find symbol final Client ccsClient = Client.prepareCcsClient(fcmProjectSenderId, fcm ServerKey, true); // true for debugging
^
symbol: class Client location: class EntryPoint EntryPoint.java:24: error: cannot find symbol final Client ccsClient = Client.prepareCcsClient(fcmProjectSenderId, fcm ServerKey, true); // true for debugging
^
symbol: variable Client location: class EntryPoint EntryPoint.java:28: error: cannot find symbol } } catch (XMPPException | InterruptedException e) {
^
symbol: class XMPPException location: class EntryPoint EntryPoint.java:33: error: cannot find symbol final String messageId = Util.getUniqueMessageId();
^
symbol: variable Util location: class EntryPoint EntryPoint.java:35: error: cannot find symbol dataPayload.put(Util.PAYLOAD_ATTRIBUTE_MESSAGE, "This is the simple samp le message");
^
symbol: variable Util location: class EntryPoint EntryPoint.java:36: error: cannot find symbol final CcsOutMessage message = new CcsOutMessage(toRegId, messageId, data Payload);
^
symbol: class CcsOutMessage location: class EntryPoint EntryPoint.java:36: error: cannot find symbol final CcsOutMessage message = new CcsOutMessage(toRegId, messageId, data Payload);
^
symbol: class CcsOutMessage location: class EntryPoint EntryPoint.java:37: error: cannot find symbol final String jsonRequest = MessageHelper.createJsonOutMessage(message);
^
symbol: variable MessageHelper location: class EntryPoint 11 errors
C:\Users\T\AndroidStudioProjects\MyApplicationnn\Server\src\main\java\com\example\ Server>
Please answer! Please...
android gradle jar error
The cause of the problem is simple.
The library I used in the grays was downloaded to a specific location, but I couldn't find it because there was no library path in the classpath during runtime.
Is it intelijidea if it's an Android studio?
I remember that I was able to set the maven repertoire where I set the class pass. Add the required libraries.
Under the user directory, the jar files downloaded by the gradle in .gradle/caches will be saved.
© 2024 OneMinuteCode. All rights reserved.