delivery-app-mobile icon indicating copy to clipboard operation
delivery-app-mobile copied to clipboard

android assembleRelease does not work

Open jrichardsz opened this issue 4 years ago • 3 comments

Hi.

Your app look awesome :D !!!

I tried to compile for android with this command:

cd android && ./gradlew assembleRelease

And I get this error:

> Configure project :@react-native-community_async-storage
File /home/jane_done/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 28.0.3 in /home/jane_done/Apps/android/android_home/licenses
License for package Android SDK Build-Tools 28.0.3 accepted.
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" ready.
Installing Android SDK Build-Tools 28.0.3 in /home/jane_done/Apps/android/android_home/build-tools/28.0.3
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" complete.
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" finished.
Checking the license for package Android SDK Platform 28 in /home/jane_done/Apps/android/android_home/licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in /home/jane_done/Apps/android/android_home/platforms/android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.

> Task :react-native-gesture-handler:compileReleaseJavaWithJavac FAILED
/tmp/workspace/delivery-app-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:37: error: cannot find symbol
import androidx.annotation.Nullable;
                          ^
  symbol:   class Nullable
  location: package androidx.annotation
/tmp/workspace/delivery-app-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.java:12: error: cannot find symbol
import androidx.annotation.Nullable;

My environment is:

  • ubuntu
  • node 10

How can I generate an apk file for testing purposes?

jrichardsz avatar Sep 21 '20 13:09 jrichardsz

Try with: cd android && ./gradlew app:assembleRelease

leo-gtx avatar Sep 26 '20 12:09 leo-gtx

I have other errors:

/tmp/delivery-app-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
                         ^
/tmp/delivery-app-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:11: error: cannot find symbol
import androidx.annotation.Nullable;

I try to fix it

jrichardsz avatar Sep 27 '20 02:09 jrichardsz

I reviewed these links

  • https://stackoverflow.com/questions/32634352/react-native-android-build-failed-sdk-location-not-found
  • https://stackoverflow.com/questions/56069906/cant-resolve-symbol-android-support-v4-util-pools-in-react-native-gesture-handl/56956104
  • https://github.com/software-mansion/react-native-gesture-handler/issues/761

And only this work for me:

add this on ./android/gradde.properties

android.useAndroidX=true
android.enableJetifier=true

I have another errors but I think they are related to another topics

jrichardsz avatar Sep 27 '20 02:09 jrichardsz