Closed Xgamefactory closed 5 years ago
When exactly is this error occurring?
during the packaging apk
maybe because there are two distriqt.extension.customresources.android.jar inside Android-ARM and Android-x86 folders ?
or conflict with other distriqt extensions
There shouldn't be any other extensions using that package name. Are you sure you only have one version of the custom resources ANE in your project?
yes only one ane file.
i have attached ane file generated by your ant compiler. if you have a test com.distriqt.CustomResources.ane send me i will check it maybe there is something from with my CustomResources.ane
the plugin you have sent has compiled without error.
but mine gives error. there is only icons generated from https://romannurik.github.io/AndroidAssetStudio/icons-notification.html#source.type=image&source.space.trim=1&source.space.pad=0&name=ic_stat_notificationicon
did you compile it with your ant script that on github ? it seams adding R class into jar that is the conflict. Weird but there is no resource defined in java library in your ane file. no ic_stat_distriqt resource defined in your ane file but it works. i guess it is already defined in your core extension.
You ant file was generating R file that was the conflict. generated resource after removing R gen task worked perfectly.
Can you explain a little more what you removed?
This script is exactly what we used to generate the example I sent you so that suggests to me that there is something different in our environments that's causing differences in the generated jar file.
error tells about R file conflict so after removing this part it works. win7 64bit java 1.7 jdk air sdk 23
<!-- Builds the R file -->
<aapt executable="${aapt}"
command="package"
verbose="false"
manifest="${android.dir}/AndroidManifest.xml"
originalManifestPackage="${android.package}"
androidjar="${android.sdk}/platforms/${android.target}/android.jar"
rfolder="${android.dir}/gen"
nonConstantId="${android.library}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
ignoreAssets="true"
binFolder="${android.dir}/${output.tmpdir}"
proguardFile="${android.dir}/proguard.cfg">
<res path="${android.dir}/res" />
</aapt>
I'll have to look into that, that section actually packages the resources so I'm not sure you are removing the correct part. You definitely are packaging the jar with this script?
yes. with this R building function it generates R class inside jar file check your ane and you will see that there is no R class inside your jar file.
It should be excluded from the jar.
https://github.com/distriqt/ANE-CustomResources/blob/master/build.xml#L178
Must be something with the version of Java you have not accepting that parameter.
How was this resolved? I'm receiving a similar error upon compiling an App that is using the CustomResouces ANE:
Unknown error.
unexpected failure: duplicate entry: air/com/distriqt/CustomResources/R.class java.util.zip.ZipException: duplicate entry: air/com/distriqt/CustomResources.class at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:232)
Note: I was able to bypass this by removing classes.jar from the ANE. Though I haven't been able to test my app to see if the resources are present. I'm using this for the notification icons and the value.xml (Firebase). I'm using the latest Android Studio SDK, Java, and AIR 25.
Are you using the new version of the script. It should have a completely new build process using AndroidStudio which shouldn't have this issue.
I believe so ... I grabbed it on Friday. build file is dated 6/19/17? If removing classes.jar from the ANE fixes it, I'm okay for now. No need to hop on this.
I'm also getting that exact same issue with the duplicate R.class when I compile my app with the customResources ANE. I downloaded the ANE-CustomResources-master zip file on 6/30/17
Can you tell me about your build environment, java version , android studio, os, air sdk?
Ant 1.10.1 Android 2.3.3 JDK 1.8.0.131 Windows 7 64bit AIR26 SDK
MacOS Ant 1.9.6 JDK 1.8.0_45 AIR25 SDK Android 2.3.3
is there a requirement for Android SDK Platform? Which are targeting?
What settings are you changing in the config ?
Only the top portion:air.sdk
, android.sdk
and android.package
(i'm using firebase).
Same here. I just modified those three values in the build.config file.
Oh, I also did add the FLEX_HOME property to the build.xml. Like so:
<property name="FLEX_HOME" value="C:\Programs\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0" />
Could you try using a android.package
that is slightly different from your application package?
Great, that solved the issue.
For reference, I originally had this: android.package = air.myapp
I changed it to this: android.package = air.myapp.extension.customresources
Now I'm able to successfully compile the AIR APK in Flash/Animate with the custom resource ANE. Probably should add a small note in the custom resource documentation to not name the android package as the same as the application package.
Thanks!
Sorry - finally had a chance to test this.
Switching it to the following worked like a charm (with Firebase) -
android.package = air.com.myapp.CustomResourcesExtension
Actually I'm still encountering an error related to this.
So I'm able to Publish the Android in Animate. However I can no longer run a Test Movie of the app. When I press CTRL+T to run the Test Movie in Animate, I get "Test movie launch failed" with the following error: "The content cannot be loaded because there was a problem loading an extension: Error: Duplicate platform Android-ARM found for extension com.distriqt.CustomResources"
When I remove the remove extension, then the test movie is able to run again.
Sounds like you have 2 extensions in your extensions path using that ID. Make sure you only have the extension you require in your application dir.
ane file generated with ANE-CustomResources and
rename zip to ane
com.distriqt.CustomResources.zip