distriqt / ANE-CustomResources

Android Custom Resources for AIR Applications
https://airnativeextensions.com
15 stars 4 forks source link

Build Failed #45

Closed bftrepo closed 4 years ago

bftrepo commented 4 years ago

Hello, I'm getting the following error when trying to build my ANE. My AIR and Anrdoid paths are correct. I noticed in another thread that there can be issues with trying to write to remote drives, but that's not the case in my situation. Any other ideas? My Java version is 1.8.x

Could not find file ANE-CustomResources-master/platform/android/app/build/intermediates/packaged-classes/release/classes.jar to copy.

marchbold commented 4 years ago

This normally occurs if your Android project fails to build

Double check the error messages earlier in the script. It most commonly related to an invalid resource.

bftrepo commented 4 years ago

This is the error I'm seeing.

The ' characters around the executable and arguments are
not part of the command.
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] Could not determine java version from '12.0.2'.
     [exec] 
     [exec] * Try:
     [exec] 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.
     [exec] 
     [exec] * Get more help at https://help.gradle.org
     [exec] Result: 1
     [exec] Current OS is Mac OS X
     [exec] Executing './gradlew' with arguments:
     [exec] 'assemble'
     [exec] 
     [exec] The ' characters around the executable and arguments are
     [exec] not part of the command.
Execute:Java13CommandLauncher: Executing './gradlew' with arguments:
'assemble'
marchbold commented 4 years ago

Hi,

You are using the wrong version of java. You must use 1.8 (8) to package android applications / libraries including AIR.

Try downgrading your java version or installing 1.8 and changing your java home environment variable.

bftrepo commented 4 years ago

Hi, I verified that I'm using ver. 1.8.x, but still no luck.

java version "1.8.0_241" $java_home = /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home

marchbold commented 4 years ago

Are you still getting the error above? As it says it's finding version 12.0.2.

Could not determine java version from '12.0.2'.
bftrepo commented 4 years ago

Yes, that's right.

build_android:
     [echo] Building Android library...
    [lower] Warning: Nashorn engine is planned to be removed from a future JDK release
    [lower] 
   [topath] Warning: Nashorn engine is planned to be removed from a future JDK release
   [topath] 

build_android_osx:
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] Could not determine java version from '12.0.2'.
     [exec] 
     [exec] * Try:
     [exec] 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.
     [exec] 
     [exec] * Get more help at https://help.gradle.org
     [exec] Result: 1
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] Could not determine java version from '12.0.2'.
     [exec] 
     [exec] * Try:
     [exec] 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.
     [exec] 
     [exec] * Get more help at https://help.gradle.org
     [exec] Result: 1
    [lower] Warning: Nashorn engine is planned to be removed from a future JDK release
    [lower] 
   [topath] Warning: Nashorn engine is planned to be removed from a future JDK release
   [topath] 

build_android_windows:

package:
    [lower] Warning: Nashorn engine is planned to be removed from a future JDK release
    [lower] 
   [topath] Warning: Nashorn engine is planned to be removed from a future JDK release
   [topath] 

package_android:

BUILD FAILED
Code Libraries/ANE-CustomResources-master/build.xml:228: The following error occurred while executing this line:
Code Libraries/ANE-CustomResources-master/build.xml:178: Warning: Could not find file Code Libraries/ANE-CustomResources-master/platform/android/app/build/intermediates/packaged-classes/release/classes.jar to copy.
marchbold commented 4 years ago

So the command line is still finding java version 12.0.2 on your machine. You need to either remove it or correctly set your environment.

stoff99 commented 4 years ago

Hey @bftrepo ,

you can check the java version which is used by Gradle with gradle --version. if gradle isnt available for you in the terminal you can install it with homebrew: brew install gradle. Than close and reopen your terminal and check the version again. There you will have some 12.0.2.

First of all update your Android Studio, this will also update your gradle version. than try to execute ANT build again.

If you still get the same error set the java version with: echo export "JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.bash_profile in the terminal. Close and reopen the terminal again and check again the gradle version with gradle --version.

Now you should see the 1.8.x Now try to execute the ANT build again.

marchbold commented 4 years ago

@bftrepo Did updating Android Studio help you? I believe this error is actually from an outdated gradle install so updating probably should resolve this.

bftrepo commented 4 years ago

Now I get conflicting messages. Part of the logs say build failed, but at the end it says build successful. When I check the build directory after running the process the folder is empty.

build_android_osx:
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] Could not determine java version from '12.0.2'.
     [exec] 
     [exec] * Try:
     [exec] 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.
     [exec] 
     [exec] * Get more help at https://help.gradle.org
     [exec] Result: 1
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] Could not determine java version from '12.0.2'.
     [exec] 
     [exec] * Try:
     [exec] 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.
     [exec] 
     [exec] * Get more help at https://help.gradle.org
     [exec] Result: 1
    [lower] Warning: Nashorn engine is planned to be removed from a future JDK release
    [lower] 
   [topath] Warning: Nashorn engine is planned to be removed from a future JDK release
   [topath] 

build_android_windows:

BUILD SUCCESSFUL
Total time: 3 seconds
marchbold commented 4 years ago

Did you check that you are using Java 1.8 ? This error is normally associated with an outdated gradle or too recent version of Java. Can you check both of these?

bftrepo commented 4 years ago

Here's the output from gradle --version

Gradle 6.2.2
------------------------------------------------------------

Build time:   2020-03-04 08:49:31 UTC
Revision:     7d0bf6dcb46c143bcc3b7a0fa40a8e5ca28e5856

Kotlin:       1.3.61
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          12.0.2 (AdoptOpenJDK 12.0.2+10)
OS:           Mac OS X 10.14.6 x86_64
marchbold commented 4 years ago

Looks like your java version is the issue? Can you please check you are using 1.8. That looks like you are using 12?

bftrepo commented 4 years ago

Same results with version 1.8


------------------------------------------------------------
Gradle 6.2.2
------------------------------------------------------------

Build time:   2020-03-04 08:49:31 UTC
Revision:     7d0bf6dcb46c143bcc3b7a0fa40a8e5ca28e5856

Kotlin:       1.3.61
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_241 (Oracle Corporation 25.241-b07)
OS:           Mac OS X 10.14.6 x86_64
marchbold commented 4 years ago

What is the error now? can you post the output again.

bftrepo commented 4 years ago

I've verified my java version to be 1.8 but I'm getting this error when I run ant build

Error: File error - /Users/ttodish/Documents/Code Libraries/ANE-CustomResources-master/platform/actionscript/bin/distriqt.extension.distributordisplay.swc (Permission denied)

If I run sudo ant build I don't get the permission error, but my java version is 12.0.2. Unfortunately, I'm not super experienced with terminal and I can't figure out how to set the sudo java version to 1.8. Is there a way to fix the permission error without having to use sudo to build?

marchbold commented 4 years ago

You should not need to use a super user to build this. I'd suggest a clean checkout / download of the repository to ensure you don't use su to extract or build.

bftrepo commented 4 years ago

The clean download seemed to fix the permission and versioning issues, thank you! Now I'm getting this error, however.

BUILD FAILED /Documents/Code Libraries/ANE-CustomResources-master/build.xml:241: The following error occurred while executing this line: /Documents/Code Libraries/ANE-CustomResources-master/build.xml:264: exec returned: 2

bftrepo commented 4 years ago

Okay, I think I finally got it working. I had to go through and remove all references to Android-ARM64. Thanks for your help!

marchbold commented 4 years ago

Sounds like you're not using AIR 33? The latest release has been updated to support android 64 bit which is only supported from v33.

bftrepo commented 4 years ago

Yes, that's correct. I'm using v32.