I spent much time by making my android game and i have problem now.
I cant upload it to playstore because of 64 requipment. I have readed i could add this line to build.gradle
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
Could you help me please with adding this to gradle.build?
i have found that file in Roaming\GameMaker-Studio\Android\runner\RootFiles
This is content of the file.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0+'
}
}
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
im not sure if this is correct file, tried adding this line bud has error while compiling.
Or maybe you know diffrent way to do this.
I am using GMS 1.4
I've been checking different ways to make 1.4 to generate a 64-bit compatible apk file but even if you achieve to add arm-v8a and x86_64 so Gradle try to generate it, it still needs libyoyo.so (and maybe others) compatible files for each of your new abis to make a 64bits android compatible apk.
The only way to get those files is to have the source code and cross-compile it for each of the 64-bit required abis.
Related
We have been trying to create JAR files from the LanguageTool (LT) Desktop version we downloaded that contains various JAR files. LT at this link made the statement that we needed all the files in these folders libs org and META-INF in our project. LT has repied they have no experience with Netbeans or JavaFX.
LT Directions
The app was built on Windows 7 with Netbeans 8.2 as a JavaFX 8 and Maven JDK 1.8
We tried following this tutorial the author was not much for proper code formatting and failed to mention that LT is not thread safe. We seldom work with threads but think our code is correct?
TUTORIAL
To install the Class AmericanEnglish.class which is in the LT Desktop zip file we extracted we used this process
cd C:\Users\Me\Documents\A A A A A LT UnZip\LanguageTool-4.7\LanguageTool-4.7
jar cf languagesLIBS.jar libs/*
jar cf languagesORG.jar org/*
jar cf languagesMETA.jar META-INF/*
Here is where it gets odd to our limited knowledge of adding Dependencies to Netbeans
1. Open the Projects tab.
2. Right-click on Dependencies.
3. Select Add dependency.
4. Set groupId to: language(can be anything)
5. Set artifactId to: en (can be anything)
6. Set version to: 4.7(can be anything)
7. Click Add to continue.
Dependency is added to pom.xml and appears under the Libraries node of Maven project. Continue:
1. Expand Dependencies.
2. Right-click on library (e.g., group.id).
3. Select Manually install artifact.
4. Set Artifact to install with the Java Archive (.jar) file path.
5. Click Install locally.
This process did place the AmericanEnglish.class in a JAR and it is found by Netbeans
import org.languagetool.JLanguageTool;
import org.languagetool.language.AmericanEnglish;
import org.languagetool.rules.RuleMatch;
Here is the error when we try to populate the JLanguageTool with AmericanEnglish
While the error NoClassDefFoundError would seem to indicate that the app can not find the
AmericanEnglish.class and that is the cause of the error ClassNotFoundException
Our question obviously is how do we fix this ?
And are we crating the external JAR files correctly?
Exception in thread "Thread-4" java.lang.NoClassDefFoundError: com/google/common/cache/CacheLoader
at com.mycompany.maventest.CheckSpellController.lambda$ini$0(CheckSpellController.java:43)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.google.common.cache.CacheLoader
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
We also see these warnings when we Clean and Build the project
The POM for languagetool:LIBS:jar:4.7 is missing, no dependency information available
The POM for languagetool:ORG:jar:4.7 is missing, no dependency information available
The POM for languagetool:META:jar:4.7 is missing, no dependency information available
exec-maven-plugin:1.2.1:exec (unpack-dependencies) # mavenTEST
When the Clean and Build is run we see the dependencies unpack
Here is the few lines of code that cause the error
static JLanguageTool langTool;
public void ini(){
new Thread(() -> {
langTool = new JLanguageTool(new AmericanEnglish());
}).start();
}
The ini() method is called from the initialize method
The necessary JAR files are in the Dependencies folder
The project imports these files
You need to use the actual JAR and the process where you thought it was a bit ODD
Is not the correct way to add JAR files. The extracted ZIP folder has all the gold or should we say JAR's. Here are a few screen shots and directions. That said we are still getting the NoClassDefFoundError so we will work on fixing that part of the question
Delete the three JAR's you added LIBS-4.7.jar META-4.7.jar and ORG-4.7.jar
We would also suggest opening the .m2 folder and under /repository/org/languagetool delete the languagetool folder. Do NOT worry everything will get recreated.
Right Click Dependencies folder and select Add Dependency
In the Query text field enter "org.languagetool"
Here is a comment we did not find languagetool 4.7 JAR's as central only local ? ?
You might like to try and use the central 4.6 JAR's
Expand the org.languagetool:languagetool-core folder and select the 4.7.jar
Once that JAR is in the Dependency folder Right Click ad select Copy Location
Now Right Click the same JAR once more and select Manually Install Artifact
In the Artifact To Install text box paste with a Ctrl + V
This will take you to the location of the JAR select it and presto magic the Artifact is added
Notice the language-en-4.7 we created this JAR file because we could not find AmericanEnglish.class in any of the downloaded files. See Last screen shot
Here are the screen shots in the order to match the above direction
I am not holding my breath that using the downloaded 4.7 JAR,s is the best idea
You might try reaching out to Maven and Language Tool and ask why LT 4.7 is not in the repository!
Best of Luck
I'm performing this on Windows, so some of these operations might be different for Linux/Mac users.
Steps To Reproduce
Step 1: Clone the Corda V3 Kotlin template into a new folder
git clone https://github.com/corda/cordapp-template-kotlin.git MyFirstCorDapp
Step 2: clean and deploy nodes with gradle
./gradlew clean dN
Output
This image illustrates the JAR files that have been built and deployed into a cordapp folder for a node
Questions
Why does deployNodes produce MyFirstCorDapp-0.1.jar? This file
doesn't seem necessary.
Why is cordapp-contracts-states-0.1.jar so big? Given that this
was compiled directly from the kotlin template with no changes, I'd
expect this to be much smaller.
The reason why MyFirstCordapp-0.1.jar is appearing is because of this line:
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
The root project has a kotlin plugin so creates a jar so the deployNodes deploys it.
One solution would be to use a subprojects closure to skip the root project
task deployNodes(type: net.corda.plugins.Cordform) {
subprojects.each { subproject ->
dependsOn(
subproject.tasks.matching { task ->
(task.name == 'jar')
}
)
}
The reason why cordapp-contracts-states-0.1.jar is "so big" (775 KB) is because the corda gradle plugin packs some dependencies in it.
Different flavors of this question have been asked and I would like to state for starters that none of them solve my particular use-case.
I know this is not particularly straightforward in Android Studio, but here's what I need:
I want a (gradle?) task in Android Studio to build a .jar which contains only the compiled .class files from my source code along with the .class files from the dependencies I define in my build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.*'])
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.brightcove.player:android-sdk:4.+'
compile 'com.android.support:support-v4:23.1.1'
}
I do not need it to contain other files like the manifest or anything else in the configurations.compile directory. Basically, it needs to contain all the classes that would be found in the classes.dex of the decompiled .apk file.
I am trying to create a fat jar file in a multi-project Gradle build, something like the following:
root
+-- project1
+-- project2
project1 provides the basic functionality, which is then used by project2 to create an executable jar. The executable JAR needs to contain all of the code from the dependencies so that it can be run standalone.
For external dependencies this works fine. In project2 I create a new configuration:
apply plugin: 'maven'
apply plugin: 'java'
configurations {
// configuration for JARs that need to be included in the final packaging
includeInJar
}
and then add the dependencies:
dependencies {
includeInJar 'com.fasterxml.jackson.core:jackson-databind:2.2.3'
...
configurations.compile.extendsFrom(configurations.includeInJar)
}
The packaging then looks like this:
jar {
manifest {
attributes "Main-Class": "com.acme.project1.MyTest"
}
// import all dependencies into the Jar so that it can be run easily
from {
configurations.includeInJar.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
The jar is correctly built with all of the files from the external dependencies. The problem comes with the project dependency to project1:
includeInJar project(':project1')
When this is present, I get an error when it tries to assemble the JAR that it can't find the jar (e.g. project1-0.4.0.jar) in the project1 build/libs directory as it does not exist. The message is correct, as project1 builds a SNAPSHOT jar (e.g. project1-0.4.0-SNAPSHOT.jar).
The question is, why does the configuration refer to the non-SNAPSHOT jar when the project is building SNAPSHOT jars? What can I change so that it finds the correct jar?
As a comment :
In my opinion, fatjar is not a great pattern. Maybe Gradle application plugin would fit your need ?
I found the answer to my own question.
The problem was that we have some additional scripting at the project level which is apparantly making a change to the version at the end of the configuration phase.
When the fat jar configuration is assembled, the 'plain' version is used. This is then changed to the -SNAPSHOT version before the jars are built.
Moving the from { ... } code into the build phase by wrapping it in doFirst { ... } is enough to fix the problem, although the real fix is obviously to avoid changing the version in the middle of the in the first place.
In the hope of finding the solution on Google as it seems a very general task, I've been trying to do this past few weeks but strangely I couldn't find anything!
What I'm doing:
I am writing an small application, It will be at most a 20KB JAR file in the end. However it has many dependencies, Hibernate and SLF4J to name a few. Directly including these dependencies with the jar file will make it 9Mb.
What is used:
Gradle is used as the build tool. the custom task fatJar creates the jar including all required dependency jar files from (the original) maven repository.
The problem
with my slow internet connection I'd rather not to directly include dependencies, but download these them on the server and not my local production site. What would be the Gradle task like to:
Read the dependencies from jar file
Download them (I know how to do it during Gradle build task).
Add them to class path
Add classpath defined in MANIFEST.mf too
run the jar, by main class defined in MANIFEST.mf
I've read gradle documentation over and over, but no help.