Android values-v21.xml

I got about a hundred errors like this one all for values-v21.xml and a couple for values-v23.xml

C:\Users\Desktop\Zephyr\bin\android\release\bin\deps\google-play-services\build\intermediates\res\merged\release\values-v21\values-v21.xml:13: AAPT: Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Inverse’.

Is there something I need to install from the SDK Manager?

Perhaps try adding

<android target-sdk-version="23"/>

in your project.xml. Make sure you have android api 23 downloaded.

That worked
Now I’m getting a hundred of these:

major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.

Do I upgrade the compiler and if so how, or should I downgrade Java??

Unfortunately I have never seen this error/warning :frowning: Does it compile fine?
You could try adding

but I don’t know if it would help.

It compiles a few things after that and then gives me:

  • What went wrong:
    Execution failed for task ‘:app:transformClassesWithDexForDebug’.
    com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

Doesn’t make any difference

Ok it turns out that means you can’t have more than 65336 methods in your app unless you enable multidexing, whatever that is.
I switched back to using the build.gradle template recommended by Player03 and got it compiling with this error:

Called from ? line 1
Called from CommandLineTools.hx line 1426
Called from CommandLineTools.hx line 25
Called from CommandLineTools.hx line 126
Called from CommandLineTools.hx line 635
Called from lime/project/PlatformTarget.hx line 113
Called from lime/tools/platforms/AndroidPlatform.hx line 193
Called from C:\HaxeToolkit\haxe\std/neko/_std/sys/io/File.hx line 62
Called from C:\HaxeToolkit\haxe\std/neko/_std/sys/io/File.hx line 50
Uncaught exception - [file_open,C:\Users\Liam\Desktop\Zephyr\bin\android\release/bin/app/build/outputs/apk/app-debug.apk]

Yeah, that one’s pretty annoying. Multidex is tricky to set up, and I’ve heard it makes the build a lot longer. Personally, I use ProGuard to remove the unused methods. Start with these rules:

-keep public class com.your.package.** {
    public *;
}
-keep class org.haxe.** {
    public *;
}
-keep class com.google.android.gms.common.internal.** {
    public *;
}

Also, I have no idea how to implement this.
Do you have instructions for beginners?

This error probably means you had an error earlier (search your output log) that caused the application to not be built, or it means we have a bad file path in the tools, but my first guess would be to look if there was an issue earlier in the log

Yeah it says

Note: C:\Users\Desktop\Zephyr\bin\android\release\bin\app\src\main\java\org\libsdl\app\SDLActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

But Player03 said in the other post that these are just warnings for the Lime devs to fix.
I’m in the UK so I have a long day of trying different things not knowing what I’m doing before I get a forum responses.
That’s prob why my forum posts are so erratic.

Are you referring to the the file_open error or the 65336 error?
How can i fix a bad file path in tools?

You said that removing the certificate tag fixed it. Do you get any errors about certificates when it is included? Is the path to the certificate file valid, etc?

That’s what I thought but if you read the last comment it turns out it just looked that way because it was running an old version of the .apk.

No just the file_open error

My .keystore file is in the top level of the project directory alongside project.xml.

I tried compiling with just these 2 and commenting out the rest to see what was going on
set name=“googlePlayGameServices” if=“android” />
haxelib name=“google-play-services” if=“android” />

And that led me back to the 65336 bug which Player03 advised using ProGuard to fix.
Which is why I’m back on this thread.
I usually get round that bug by including a template to a build.gradle file with this in it

apply plugin: ‘com.android.application’

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services:9.4.0'

}
But I'm not sure what that does, it certainly doesn't reduce the amount of methods in the app so I'm wondering if maybe it somehow hides the root problem?

Omg, I copied the wrong build.gradle file into my templates directory.
It looks like this now:

apply plugin: 'com.android.application'

android {
    compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
    buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
    
    defaultConfig {
        applicationId "com.antehero.Zephyr"
        minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
        targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
        versionCode Integer.parseInt(project.VERSION_CODE)
        versionName project.VERSION_NAME
    }
    
    
    signingConfigs {
        release {
            storeFile file(project.KEY_STORE)
            storePassword project.KEY_STORE_PASSWORD
            keyAlias project.KEY_STORE_ALIAS
            keyPassword project.KEY_STORE_ALIAS_PASSWORD
        }
    }
    
    
    buildTypes {
        release {
            minifyEnabled true
            signingConfig signingConfigs.release
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':deps:extension-api')
    compile project(':deps:project2')
    compile 'com.google.android.gms:play-services:9.4.0'
    
}

Have I missed anything obvious?

Getting these errors and warnings now:

:app:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: C:\Users\Desktop\Zephyr\bin\android\release\bin\app\src\main\java\org\libsdl\app\SDLActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Reading program directory [C:\Users\Desktop\Zephyr\bin\android\release\bin\app\build\intermediates\classes\release] (filtered)
Reading library jar [C:\Development\Android SDK\platforms\android-23\android.jar]
Reading library jar [C:\Development\Android SDK\platforms\android-23\optional\org.apache.http.legacy.jar]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Note: there were 8 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)

Note: there were 2 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 14 classes trying to access generic signatures using reflection.
You should consider keeping the signature attributes
(using ‘-keepattributes Signature’).
(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 1 classes trying to access enclosing classes using reflection.
You should consider keeping the inner classes attributes
(using ‘-keepattributes InnerClasses’).
(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 94 unkept descriptor classes in kept class members.
You should consider explicitly keeping the mentioned classes
(using ‘-keep’).
(http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 7 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 1 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using ‘-keep’).
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)

App closes as soon as it opens, I think I need to use the ‘-keep’ command, but I don’t know where to put it.
In a config file somewhere?

This stuff, where does it go?

Before you go ahead with ProGuard, you should check if you even need it anymore. I believe extension-googleplayservices imports the entire Play Services library, which is a lot of methods. My library imports only specific pieces (in your case, that’s the basic API + Google Play Game Services). Now that you switched, you may be back under the 65535 method limit.

To disable ProGuard, simply remove “minifyEnabled true.” If that works, you won’t have to worry about -keep at all.


If it fails, you’ll need a ProGuard configuration file. You can name your text file anything you like, but I’d suggest “zephyr.pro.” To add this file:

<template path="templates/zephyr.pro" rename="app/zephyr.pro" />

This file should include the rules I listed, and possibly also the ones ProGuard suggested.

Finally, add this line to your build.gradle file in the defaultConfig section:

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'zephyr.pro'

(Side note: I’d suggest adding resConfigs 'en' to that same section. The Google Play Services include translations for all kinds of languages, and this tag removes everything except English. If you keep those extra languages, Google Play will tell non-English-speakers that your app has been translated into their language.)

Nope, removing minifyEnabled gives the 65535 error again.

First attempt yields this error:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:transformClassesAndResourcesWithProguardForRelease’.

java.io.IOException: Can’t write [C:\Users\Desktop\Zephyr\bin\android\release\bin\app\build\intermediates\transforms\proguard\release\jars\3\1f\main.jar] (Can’t read [C:\Users\Desktop\Zephyr\bin\android\release\bin\app\build\intermediates\exploded-aar\bin.deps\project2\unspecified\jars\classes.jar(;;;;;;**/*.class)] (Duplicate zip entry [classes.jar:org/haxe/extension/BuildConfig.class]))

Ok found an explanation here.

Still not sure why I’m going over the 65536 limit.
It’s a small application and I don’t have any other libraries installed, just your google-play-services, actuate, and a small lib of my own.

Oops! This one was my fault. I misread the directions and assumed that this line imported a small amount of “basic” code:

compile 'com.google.android.gms:play-services:9.4.0'

Actually, it imports the entire Google Play Services! And then I imported individual pieces of the Services on top of that.

Please update my library and try again.

That did the trick.
Unfortunately it’s not working with extension-googleplaygames so I have no interface to work with it.
Should I just fork their extension and have a go at it myself?