0

I"m new in coding. So I don't know if I'm questioning correctly, but I really need help with this issue. I took a look at this posts: getting error while try to generate signed APK android studio 3 and Dalvik VM error: Exception found "Javax.xml.namespace.QName.class", but still didn't get a clue of what is wrong.

My app was running perfectly until I tried to generate the signed-apk, now it fails building, it says that there is 4 errors and app:mergeDebugResources failed. I get this message:

"FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugResources'.

    C:\Users\Ulla\AndroidStudioProjects\CalculaPrazoCPC - Teste - Copia (2)\app\src\main\res\dtplugin\deployJava1.dll:1:1: Error: The content is not permited in the prolog. I tried to generate signed-apk in another project, more simpler, and it went ok, so I think that's not my windows system that have the problem...

Could it be something wrong with my dependencies?

My build.gradle:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.ullaapps.calculaprazocpc"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.android.support:design:22.2.0'
}

I'm using in my xml files: android.support.v7.widget.SwitchCompat and android.support.v7.widget.AppCompatRadioButton. The gson I'm using because I have a list of custom objects stored in the sharedPreference.

The deployJava1.dll opens in my project/Android Studio, with many strange characters and with this message: " This document contains very long lines. Soft wraps were forcibly enabled to improve editor performance."

I updated my AndroidStudio to 3.0.1, and started to get this error instead:

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

So I took a look at this post: Unsupported major.minor version 52.0 when rendering in Android Studio

I tried the many solutions there but with no success. When I tried this solution: " On OSX, this is found under File > Project Structure > SDK. Or from the welcome screen in Configure > Project Defaults > Project Structure. Select the Use the embedded JDK (recommended) option instead of using your own JDK." It started show again the errors with deployJva1.dll, msvcr100.dll and classes.jsa and running with stacktrace got this:

  • Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.

and:

C:\Users\Ulla\AndroidStudioProjects\CalculaPrazoCPC - Teste - Copia C:\Users\Ulla\AndroidStudioProjects\CalculaPrazoCPC - Teste - Copia (2)\app\src\main\res\plugin2\msvcr100.dll Error:Error: The file name must end with .xml Error:Error: The file name must end with .xml Error:Error: The file name must end with .xml C:\Users\Ulla\AndroidStudioProjects\CalculaPrazoCPC - Teste - Copia (2)\app\src\main\res\server\classes.jsa Error:Error: The file name must end with .xml Error:Error: The file name must end with .xml Error:Error: The file name must end with .xml

I want to cry!!! I'm getting really frustrated now that I would publish my app and this happens. If someone can help me I would be very grateful.

Ulla
  • 70
  • 9
  • Just a suggestion, As you said you are new in coding . AS 1.2 is too old . Why don't you use latest version? – ADM Feb 22 '18 at 04:42
  • The XML prolog probably has invalid characters in it then, so you could try to run the XML it is stuck on through an XML-validator and replace it. – G_V Feb 22 '18 at 10:23
  • @ADM - I was thinking of doing that, update the android studio, but was a bit afraid it could get worse, that it could appear more incompatibility, but I will try it. – Ulla Feb 22 '18 at 11:54
  • @G_V I have had a look at my xml-layout files but didn't find any invalid characters. I'm using strings.xml with portuguese characters as (ç,ã,é,...), but the code was running ok with that before I tried to sign the apk, can I be forgetting to configure something about that? That's creating the problem only now? – Ulla Feb 22 '18 at 12:04
  • @Ulla - That's probably it. You probably have UTF8 libraries on your machine that allow you to interpret the characters that aren't available by default. English doesn't have `ç,ã,é` so if you search and replace those, chances are it will work fine. Assuming they are in the prolog. – G_V Feb 22 '18 at 12:53
  • @G_V - I replaced all those characters, in the strings.xml but it didn't make any difference... it is still pointing to the same four errors :( .. I'm struggling for three days already...trying to find a solution... – Ulla Feb 23 '18 at 01:21
  • @ADM - I updated my Android Studio to 3.0.1, and I updated my question...still getting errors...that I have no idea how to fix... I want to cry – Ulla Feb 23 '18 at 03:01
  • @Ulla did you also check the whitespaces used in your XML prolog? – G_V Mar 02 '18 at 11:05
  • when I updated the android Studio I got error in many parts of the code, so I made a new code copying step by step, testing every bit, to correct the incompatibiity, now it's working was the best solution I found – Ulla Nov 18 '19 at 20:34

0 Answers0