Android - Phonegap - Conversion to Dalvik format failed with error 1 - android

I installed this:
https://github.com/mwbrooks/cordova-plugin-menu
and have cordova 1.8.1 installed.
I copied "libs/phonegap-1.0.0.jar" to ANDROID_PROJECT/libs.
When i try and run the app in the simulator, i get :
"Conversion to Dalvik format failed with error 1"
I believe this is to do with conflicts with libraries, but I don't know what to do to remove the error?
please help.

I have found myself in the same situation after upgrading from 2.0.0 to 2.1.0
First of all make sure you have reconfigured the build path by removing the JAR from the old PhoneGap version and adding the new one.
At this point I started getting the Dalvik error. Cleaning the build environment didn't help.
So I remove the old jar from the libs directory and voilá, it worked.

Project -> Turn off Build Automatically. Then Build project manually and clean. Then export signed project. Problem has been gone.

Related

On Unity 2018.1 Android gradle build failing with 'library uses same package'

This issue appears after update to Unity 2018.1. On 2017.3.1 version everything worked fine.
Gradle version: 3.3
Android Plugin version: 2.3.3
Does anyone have an idea how to fix following error?
CommandInvokationFailure: Gradle build failed.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -classpath "C:\Program Files\Unity2018\Editor
\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar"
org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ': processReleaseResources'.
> Error: A library uses the same package as this project: com.unity3d.player
The problem was caused by Simple Android Notifications Free asset (https://assetstore.unity.com/packages/tools/integration/simple-android-notifications-free-68626).
AndroidManifest file in simple-android-notifications.aar contains package="com.unity3d.player"
After renaming it to "com.hippogames.simpleandroidnotifications" I now able to build APK.
The strange thing is that the same library was successfully used with Unity 2017.3.1 and plugin worked as expected.
I tried million things, but only this solved my problem:
When adding facebook sdk package to assets, it creates Facebook SDK folder, and plugins are in it. So :
1. I moved everything from inside Facebook SDK folder to Assets folder.
2. Then I go to Assets/PlayServicesResolver/AndroidResolver/Force Resolve (Don't know if this is necessary).
It appears that unity couldn't find the path to plugins for android. I lost 5 days in searching the solution.
follow these steps and rebuild the project
Goto File from unity top Menu
Select Build Settings
From Build Setting click on Player Settings
In Player Setting Inspector Menu Select Other Settings
See for Identification->Package Name
change Package Name to something unique like com.yourname.appname
and save the project and build again

Android project building error - Symbol file with package cannot be empty

I have cloned an android project from gitlab. After building the project it shows the below error with build failed.
java.io.IOException: Internal error: Symbol file with package cannot be empty.
The project is okay on the other android studio from where it pushed to gitlab. what should I do to prevent this error. thanks in advance.
the solution that worked for me was to change the Gradle version from project structure.
in my case, I changed the version to match the local Gradle distribution I downloaded before and then going into Gradle setting in the project settings to check the use local Gradle distribution option of the same version.

How to fix com.android.builder.internal.aapt.AaptException: Failed to crunch file?

I have the latest version of Android Studio (as of Sep 21, 2016). When I create a brand new project in Android Studio and try to build it, I am getting this build error:
Error: com.android.builder.internal.aapt.AaptException: Failed to
crunch file
H:..pathTo..\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\24.2.1\res\drawable-xhdpi-v4\abc_list_selector_disabled_holo_light.9.png
into
H:..pathTo..\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_list_selector_disabled_holo_light.9.png
What does this mean? And how do I fix it?
Build log:
https://jpst.it/NCnu
Amazing. It's 2016 and Google's tool chain still has these annoying file path limitations.
Error: File path too long on windows, keep below 240 characters
Move project further up your project file path and the problem goes away!
There is a workaround. If you add the following to the project build.gradle file, inside the allprojects section, it will move the Build output files to this folder. Meaning the app will now build.:
buildDir = "C:/tmp/${rootProject.name}/${project.name}"
It does give you an additional app module at the root of the project but this is a much more convenient option than moving whole Project folder path.
I Found the same Error (Error: com.android.builder.internal.aapt.AaptException: Failed to crunch). I Copied the directory one level above. It Works!
The solution that help me was to delete node_modules folder,
remove android platform by running the command ionic platform remove android
and then go upper the project folder in system hirarchy
and then:
npm install
ionic platform add android
ionic run android
I faced this problem when trying to generate an unsigned apk using Gradle in Android Studio IDE 3.0
I solved it by creating a fresh new project and copied each file with the slightest amendment needed e.g. changing the package name, but I left the icons as they are thus I haven't added a new icon in several files like I did in the previous project.
And the problem was solved, it builds with no such error.
(However the generated apk file wasn't found in app\build\outputs\apk but inside app\build\outputs\apk\debug, but that's another problem which is not so important I hope).
I encountered a similar error. Just try to reduce the path length by moving the project folder up.
This will surely solve the problem.
Update you gradle to latest one, it solve the problem, i was also facing same problem, it work for me.
I was using classpath 'com.android.tools.build:gradle:2.0.0', then replace to
classpath 'com.android.tools.build:gradle:3.0.0' , it work for me.

Compiling Hello-Jni failure in eclipse only when opening the hello-jni.c file in eclipse

I have been trying endlessly to build the sample HelloJni sample project for the Android NDK.
How I set up the environment:
I followed the instructions of the getting started in the docs: android-ndk-r10d\docs\Getting_Started/html/index.html:
Downloaded Eclipse Luna
Downloaded the Android SDK
Downloaded the Android NDK: android-ndk-r10d
Set the NDK installation folder in eclipse in preferences window -> android -> NDK.
Imported the hellp-jni sample.
Right click on the HelloJni Project -> Android tools -> Add native support.
Cleaned and Built the project.
Ran on my device the HelloJni library (not the tests)
And the app is running and everything is WORKING and I can see the generated .so file per architecture in the libs folder of the project (for every architecture, for example armebi, mips, etc...)
Here is a Print Screen showing everything is working:
Now here comes the strange part...
The Problem:
If I open the hello-jni.c file for editing or viewing in eclipse, I suddenly see compilation errors and I can't build and can't run the project anymore...
Here is a Print Screen showing that after i open the file, I suddenly get compilation errors:
What I have already tried but failed:
Adding the Android Native Nature, then removing it by:
Deleting the .project file,
the buildCommand tag of: org.eclipse.cdt.managedbuilder.core.genmakebuilde,
the buildCommand tag of: org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
and removing the lines:
[nature]org.eclipse.cdt.core.cnature[/nature]
[nature]org.eclipse.cdt.core.ccnature[/nature] [nature]org.eclipse.cdt.managedbuilder.core.managedBuildNature[/nature] [nature]org.eclipse.cdt.managedbuilder.core.ScannerConfigNature[/nature]
removing the .cproject and all compiled files.
Then adding back the Android Native Nature.
According to this stackoverflow link:
Eclipse ADT - Unresolved inclusion jni.h
Failed
Once I got the error of (I am not getting it anymore): Unable to launch cygpath. Is Cygwin on the path?] java.io.IOException: Cannot run program "cygpath". So I Googled and I changed the build settings to give the absolute path of my NDK installation folder:
According to this stackoverflow link:
Unable to launch cygpath in android
Here is a Print Screen:
Failed
Changing the Used tools from Android GCC Compiler to GCC C Compiler
according to this stackoverflow link:
Android NDK build, Method could not be resolved
Here is a Print Screen:
Failed
Copying an eclipse Luna installation from a friend that has the project working for him.
Failed
I have been spending hours on this and I couldn't find any solution to why this is happening.
PLEASE HELP
This is a common problem when you try to edit a C/C++ file inside a JAVA workspace/perspective without the proper configuration. You can simply select all the entries in the Error Log and delete them.
FWIW, Eclipse seems to have issues with the r10d version of Android NDK. See https://code.google.com/p/android/issues/detail?id=97023. I suggest you try r10c instead #worksforme :)

How to resolve Conversion to Dalvik format failed with error 1 in Android?

I have written a sample application on using TabHost. I am getting the following error:
Conversion to Dalvik format failed with error 1
How do I resolve the above issue?
First, update to the very latest ADT. I had the identical issue and it was caused by a bug in the tools.
Second, clean the affected project and try again.
I was getting this because I had manually added android.jar to the build libraries because it was saying it wasn't finding the android libraries. The fix was to...
Remove android.jar from the build libraries
Right click on the project, go to "Android Tools", and select "Fix Project Properties"
Hope this helps.

Categories

Resources