Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build apk with :app:assembleRelease #91

Open
kickbk opened this issue Feb 27, 2023 · 6 comments
Open

How to build apk with :app:assembleRelease #91

kickbk opened this issue Feb 27, 2023 · 6 comments

Comments

@kickbk
Copy link

kickbk commented Feb 27, 2023

I need to build a development client apk to be installed on a device.

When building an apk with :app:assembleDebug, or when building an aab for production with :app:bundleRelease, it builds correctly.

It fails when building a apk development client that is to be installed on the phone (:app:assembleRelease). Is there a way to build this without running into Direct local .aar file dependencies are not supported when building an AAR?

I believe your proposed PR with compileOnly fix does not apply here. I tried it and it failed an apk with :app:assembleRelease

I should mention that on Expo, I can see Running 'gradlew :app:assembleRelease' in /home/expo/workingdir/build/apps/myApp/android, which is equivalent to your proposed solution here and here

@kickbk kickbk added the Status: triage Start out by looking at issues label Feb 27, 2023
@bandit-ibayashi bandit-ibayashi self-assigned this Mar 16, 2023
@bandit-ibayashi
Copy link
Member

@kickbk Thank you for your information. I am confirming this issue, so thank you for your patience.

@bandit-ibayashi
Copy link
Member

I have confirmed that this does not fail for our sample SDK that do not have the compileOnly fix applied, with a build using./gradlew :app:assembleRelease command.

If I have made some misunderstanding, please let me know. If so, I would appreciate it if you would share your environmental information and expected behavior as well as the actual information as it is in the template.

Thank you!

@bandit-ibayashi bandit-ibayashi added Status: question Further information is requested and removed Status: triage Start out by looking at issues labels Mar 27, 2023
@ngaiyuekeung
Copy link

ngaiyuekeung commented Mar 28, 2023

Same problem, building APK with Android Studio

Executing tasks: [:app:assembleRelease, :app:assembleReleaseUnitTest] in project

full error message:

Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-star-io10 project caused this error

os version: macOS 13.3 (m1)
Android Studio Electric Eel | 2022.1.1 Patch 1
jdk runtime version: 11.0.15+0-b2043.56-8887301 aarch64
active build variant: release

Also tried run ./gradlew :app:assembleRelease, same error

 * What went wrong:
  Execution failed for task ':react-native-star-io10:bundleReleaseLocalLintAar'.
   > Error while evaluating property 'hasLocalAarDeps' of task ':react-native-star-io10:bundleReleaseLocalLintAar'
    > Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-star-io10 project caused this error: /Users/Norris/Projects/chukmarket/dashboard/node_modules/react-native-star-io10/android/src/lib/stario10.aar

I am not sure this information is enough, please let me know if you need more information.

@justduy
Copy link

justduy commented Apr 19, 2023

I also have the same issue when building the apk. @kickbk did you find a solution in the end? I have tried to build both with and without expo and have no luck in bulidling any apk.

@bandit-ibayashi did you run the building on mac or windows? I tried to extract the example to it own project and replaced the react-native-star-io10 version in package.json with "1.3.0". When I try to build, it fails as described above. It can run locally fine, but cannot assemble any apk.

@bandit-ibayashi bandit-ibayashi added Status: work in progress Currently working on this issue Platform: android Target: other and removed Status: question Further information is requested labels Apr 25, 2023
@Bolli17
Copy link

Bolli17 commented May 9, 2023

Any update on this @bandit-ibayashi ?

@kfernandes29
Copy link

This is a known issue. Make the two changes here in the node_modules/react-native-star-io10 folder:

https://github.com/star-micronics/react-native-star-io10/pull/56/files

@can-miki can-miki added to be updated Fixed in a future update Status: fixed Enhancements that have been requested and implemented Status: resolved Solved or Answered and removed Status: work in progress Currently working on this issue to be updated Fixed in a future update Status: fixed Enhancements that have been requested and implemented labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants