I try to generate my IPA with $ gradlew ios:generateIPA from commandline but I receive this error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ios:createIPA'.
> No #Marshaler found for parameter 3 of #Callback method<org.robovm.apple.uikit.UIApplication: long $cb$beginBackgroundTaskWithExpirationHandler$(org.robovm.apple.uikit.UIApplication,org.robov m.objc.Selector,java.lang.Runnable)>
I have unpacked the lastest robovm release under Downloads, and I also updated robovm eclipse plugin. All to 0.0.11.
My build.gradle is configurated with roboVMVersion = "0.0.11".
What could be the problem?
Thanks!
SOLVED!
It's necessary to create a new App ID from member center, if I want to generate a IPA of my game.
Related
The application which I am working on is debugging fine in emulator or in mobiles but when I try to build the apk it gives the following Error:
Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':image_picker_android:debugUnitTestRuntimeClasspath'.
> Failed to transform bcprov-jdk15on-1.68.jar (org.bouncycastle:bcprov-jdk15on:1.68) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /home/cicada/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.68/46a080368d38b428d237a59458f9bc915222894d/bcprov-jdk15on-1.68.jar.
> Failed to transform '/home/cicada/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.68/46a080368d38b428d237a59458f9bc915222894d/bcprov-jdk15on-1.68.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 19s
Running Gradle task 'assembleRelease'... 20.7s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
This was my solution which I recommend to be the 2nd option:
Solution 1:
I added following lines in the android directory of app level build.gradle i.e android/app/build.gradle of my project.
lintOptions {
disable 'InvalidPackage'
disable "Instantiatable"
checkReleaseBuilds false
abortOnError false
}
And every thing started to work fine.
Check out my Gradle File
Solution 2:
However I suggest you people by the solution of #Vinadon and agree with the comment of #raiderOne:
1st recommended solution should be:
The issues lies in image_picker_android being updated to gradle 7.1.2. See their changelog. Following an issue on GitHub you have to update your gradle version like so:
In android/gradle/wrapper/gradle-wrapper.properties update your distributionUrl to
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
and in android/build.gradle change the gradle version to at least 7.1.2
classpath 'com.android.tools.build:gradle:7.1.2
In #Vinadon case, He had to update his Android Studio for a newer Java version too.
Upvote Vindadon answer below for this solution. Thanks!
The issues lies in image_picker_android being updated to gradle 7.1.2. See their changelog. Following an issue on GitHub you have to update your gradle version like so:
In android/gradle/wrapper/gradle-wrapper.properties update your distributionUrl to
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
and in android/build.gradle change the gradle version to at least 7.1.2
classpath 'com.android.tools.build:gradle:7.1.2
In my case, I had to update my Android Studio for a newer Java version too.
Let me help you a little bit in finding the correct place to paste the code
1: Go to your app-level build.grade.
2:Scroll down to "android{ "
paste this code carefully(not disturbing any other brakets.)
lintOptions {
disable 'InvalidPackage'
disable "Instantiatable"
checkReleaseBuilds false
abortOnError false
}
3:run "flutter clean"
4:run "flutter pub get"
5:If you want to build apk of your project then run "flutter build apk"
I hope it works for you.
The solution is actual on 06.06.2022. Adding these lines in pubspec.yaml fixed the problem:
dependency_overrides:
image_picker_android: 0.8.4+13
if you are using flutter 3.0 and image_picker, try this:
dependency_overrides:
image_picker_android: 0.8.4+13
This issue is usually because the gradle plugin is outdated. If your project was created using an older version of flutter the gradle plugin will be old. The actual fix to this issue would be to upgrade the gradle plugin version.
Refer to this issue
You can use android studio to do this for you or just edit the files on your own.
if you are using flutter 3.3 and image_picker, try this:
dependency_overrides:
image_picker_android: 0.8.5+3
I had the same issue, I fixed that by adding the line android.jetifier.blacklist=org.robolectric.*,bcprov in gradle.properties
This is the error message I got,
Tring to integrate with JIB (Containerize your Gradle Java project) with my Java project.
Following this documentation: https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin
Added the following to my project:
dependencies {
classpath("gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:3.1.4")
}
apply plugin: 'com.google.cloud.tools.jib'
jib.to.image = 'my-docker-local/my-app'
Gradle version is: 5.6.4
The compilation with "./gradlew" build is working fine. but, when
excecuting "gradle jib" getting the following error:
gradle jib To honour the JVM settings for this build a single-use
Daemon process will be forked. See
https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
FAILURE: Build failed with an exception.
Where: Build file '/Users/igorgumush/dev/java11/my-service/build.gradle' line: 139
What went wrong: A problem occurred evaluating root project 'my-service'.
Could not find method compile() for arguments [org.springframework.boot:spring-boot-starter-web,
build_9nl2gys0kuhc8m4mdlq51u41r$_run_closure4$_closure24#6ea6088b] on
object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 8.0.
Well the solution was very simple.
I used:
./gradlew jib
instead of
grade jib
i'm trying to reBuild and compile my Android Studio project, it worked good before installing the new version of react-native-jumio-mobilesdk for react native. After upgrading that library to 3.9.1, i had this error and i have not been able to fix it.
> Task :react-native-jumio-mobilesdk:compileDebugKotlin FAILED
Execution failed for task ':react-native-jumio-mobilesdk:compileDebugKotlin'.
Could not resolve all files for configuration ':react-native-jumio-mobilesdk:debugCompileClasspath'.
Failed to transform bcprov-jdk15on-1.67.jar (org.bouncycastle:bcprov-jdk15on:1.67) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
> Execution failed for JetifyTransform: C:\Users\UsuarioDA1.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcprov-jdk15on\1.67\8c0998045da87dbc2f1d4b6480458ed811ca7b82\bcprov-jdk15on-1.67.jar.
> Failed to transform 'C:\Users\UsuarioDA1.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcprov-jdk15on\1.67\8c0998045da87dbc2f1d4b6480458ed811ca7b82\bcprov-jdk15on-1.67.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)
Please file a bug at http://issuetracker.google.com/issues/new?component=460323.
I have one entire week trying to fix it but so far I have not been able.
I appreciate your help. :D
For me the issue occured when I tried to update the firebase crashlytics gradle plugin to 2.7.1.
It was possible to fix it by setting android.jetifier.blacklist=bcprov-jdk15on in gradle.properties as mentioned here.
Try this :
clear project cache
upgrade packages for ex. in flutter we use flutter pub get
add :
android.jetifier.blacklist=bcprov-jdk15on
to your gradle.properties file and rebuild the project. if not resolved please refer to similar issue on github and google
The problem is solved, read the last section.
The "background"
I'm making a ToDoApp just for a side project, as an excuse to learn Gradle. The initial build worked fine and the JAR worked as expected.[a]. But that version had no external dependencies; it was self-contained.
I was encouraged to add persistence to the project and I decided to use the GSON library (version 2.6.2) to work with JSON. I use IntelliJ IDEA (2016.1.2) to write code.
Now, I added the gson-2.6.2 artifact via the Maven Repository option in IntelliJ (in Project Structure). While writing the code, I added the library to the classpath of the project when prompted by IntelliJ. The code compiles and works fine when I run it in my IDE. Here's a sample run:
========ToDo App========
The following commands are recognised:
► help
Display this help message.
► add <name>
Add a new Todo task with the given name and also displays its corresponding ID.
► get <id>
Displays the task with the given id.
► mark <id>
Toggles the given task as completed or incomplete.
► print
Displays all tasks in order of their creation.
► update <id> <new text>
Updates the item with the given id to store the new text.
► del <id>
Deletes the task with the given id.
► exit
Exit the program.
The tasks are :
>> add Get the Gradle build to work.
New item added with id = 1
>> add Push the stable system to GitHub and wait for Travis to give the green signal.
New item added with id = 2
>> add Proceed
New item added with id = 3
>> print
The tasks are :
• Get the Gradle build to work. [ID: 1 Completed: false]
• Push the stable system to GitHub and wait for Travis to give the green signal. [ID: 2 Completed: false]
• Proceed [ID: 3 Completed: false]
>> exit
It works fine. The JSON data gets saved as I expect:
{"currentId":3,"toDos":{"1":{"id":1,"name":" Get the Gradle build to work. ","completed":false},"2":{"id":2,"name":" Push the stable system to GitHub and wait for Travis to give the green signal.","completed":false},"3":{"id":3,"name":" Proceed","completed":false}}}
When I rerun the code, the data is read back properly. I'm very happy with my code.
The "situation"
Here's my build.gradle:
group 'ml.cristatus'
version = '0.2'
apply plugin: 'java'
sourceCompatibility = 1.7
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.code.gson:gson:2.6.2'
}
jar {
manifest {
attributes 'Main-Class': 'ml.cristatus.todo.ToDoApp'
}
}
When I run gradle build on my Ubuntu 16.04 terminal, the JAR file is built with the following output:
:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build
BUILD SUCCESSFUL
Total time: 7.036 secs
This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.13/userguide/gradle_daemon.html
So I somehow managed to make the thing compile. But when I try to run it, using java -jar build/libs/ToDoApp-0.2.jar, the code doesn't work:
========ToDo App========
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gson/Gson
at ml.cristatus.todo.repository.ToDoRepositoryWithJSON.<init>(ToDoRepositoryWithJSON.java:25)
at ml.cristatus.todo.ToDoApp.REPL(ToDoApp.java:38)
at ml.cristatus.todo.ToDoApp.main(ToDoApp.java:17)
Caused by: java.lang.ClassNotFoundException: com.google.gson.Gson
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
I'm probably making some newbie mistake, but I can't seem to be able to put my finger on it. What am I doing wrong? It is also interesting to note that the code compiles yet it can't find the gson artifact. I'm guessing it has something to do with the classpath? I don't know. I'm not sure.
Please help me in this regard.
Solution
I just added this line to the jar {} block:
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
Courtesy of this tutorial.
[a]Here's the version 0.1 binary.
You have to add jar file with gson jar to classpath. When you are starting application ("java -jar build/libs/ToDoApp-0.2.jar"). There is multiple ways it can be achiveved.
One possible way is:
Add task into your gradle, which copy dependencies (gson.jar in your case) into "lib" directory. And when you are starting your application, add it to classpath. For example in this way "java -cp build/lib/gson.jar -jar build/libs/ToDoApp-0.2.jar"
Maybe better for you will be:
Add dependencies into your manifest. It is discussed in this answer how to copy the dependencies libraries JARs in gradle
It should work for you.
Next Option is:
Create an "uberjar" it means add all dependencies into one big jar file. Personally I don't like it. But it will work in your case. How to create uberjar in gradle is here discussed here: Building a uberjar with Gradle
I'm new to React Native and have been playing around with one or two examples. When I try and build the Android "Movies" Example on my Mac I get the following error:
./gradlew :Examples:Movies:android:app:installDebug
:ReactAndroid:downloadJSCHeaders FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ReactAndroid:downloadJSCHeaders'.
javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair
I've done npm install from the react-native directory that gets me this far and have the SDK and NDK locations set in my ./bash_profile. I've read elsewhere that my it could be something to do the the Android NDK version, I've tried using both android-ndk-r10c and android-ndk-r11c
Any help appreciated.
If anyone is looking for the solution, you need to add this line to the buildscript dependencies in the android/build.gradle file
classpath 'de.undercouch:gradle-download-task:3.1.2'
I eventually found a solution.
Instead of trying to compile the React Native example from inside the git cloned react-native directory I moved it into a completely fresh project e.g.
cd ~/Documents
react-native init Movies
Then copied the js files from the examples folder in the newly created one and ran in ios.
I'm not sure what the complication was but this resolved my issues.