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

Android react-native 0.72.6 failed to build #32

Open
alanwong0922 opened this issue Jan 26, 2024 · 1 comment
Open

Android react-native 0.72.6 failed to build #32

alanwong0922 opened this issue Jan 26, 2024 · 1 comment

Comments

@alanwong0922
Copy link

Android react-native 0.72.6 failed to build

Project information

 "react": "18.2.0",
 "react-native": "0.72.6",
 "react-native-image-tools-wm": "^1.5.8",

android/app/build.gradle

...
dependencies {
...
    implementation project(':react-native-image-tools-wm')
...
}
...

android/setting.gradle

rootProject.name = 'XXXXXXXXX'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
includeBuild('../node_modules/@react-native/gradle-plugin')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-image-tools-wm'
project(':react-native-image-tools-wm').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-image-tools-wm/android')

include ':app'

android/app/src/... /MainApplication.java

package com.XXXX; 
import android.app.Application;
import net.wowmaking.RNImageToolsPackage;
...
  private final ReactNativeHost mReactNativeHost =
      new DefaultReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
          return BuildConfig.DEBUG;
        }

        @Override
        protected List<ReactPackage> getPackages() {
          @SuppressWarnings("UnnecessaryLocalVariable")
          List<ReactPackage> packages = new PackageList(this).getPackages();
          // Packages that cannot be autolinked yet can be added manually here, for example:
          // packages.add(new MyReactNativePackage());
          packages.add(new RNImageToolsPackage());
          return packages;
        }
...

When I build the project with the android device

Note: Recompile with -Xlint:unchecked for details.
Note: /[XXX]/node_modules/react-native-get-location/android/src/main/java/com/github/douglasjunior/reactNativeGetLocation/util/GetLocation.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:9: error: package android.support.media does not exist
import android.support.media.ExifInterface;
                            ^
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:217: error: cannot find symbol
                        ExifInterface.TAG_ORIENTATION,
                        ^
  symbol:   variable ExifInterface
  location: class Utility
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:218: error: cannot find symbol
                        ExifInterface.ORIENTATION_UNDEFINED
                        ^
  symbol:   variable ExifInterface
  location: class Utility
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:216: error: cannot find symbol
                return new ExifInterface(filename).getAttributeInt(
                           ^
  symbol:   class ExifInterface
  location: class Utility
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:235: error: cannot find symbol
                        ExifInterface.TAG_ORIENTATION,
                        ^
  symbol:   variable ExifInterface
  location: class Utility
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:236: error: cannot find symbol
                        ExifInterface.ORIENTATION_UNDEFINED
                        ^
  symbol:   variable ExifInterface
  location: class Utility
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:234: error: cannot find symbol
                return new ExifInterface(stream).getAttributeInt(
                           ^
  symbol:   class ExifInterface
  location: class Utility
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:250: error: package ExifInterface does not exist
            case ExifInterface.ORIENTATION_NORMAL:
                              ^
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:252: error: package ExifInterface does not exist
            case ExifInterface.ORIENTATION_FLIP_HORIZONTAL:
                              ^
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:255: error: package ExifInterface does not exist
            case ExifInterface.ORIENTATION_ROTATE_180:
                              ^
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:258: error: package ExifInterface does not exist
            case ExifInterface.ORIENTATION_FLIP_VERTICAL:
                              ^
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:262: error: package ExifInterface does not exist
            case ExifInterface.ORIENTATION_TRANSPOSE:
                              ^
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:266: error: package ExifInterface does not exist
            case ExifInterface.ORIENTATION_ROTATE_90:
                              ^
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:269: error: package ExifInterface does not exist
            case ExifInterface.ORIENTATION_TRANSVERSE:
                              ^
/[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java:273: error: package ExifInterface does not exist
            case ExifInterface.ORIENTATION_ROTATE_270:
                              ^
Note: /[XXX]/node_modules/react-native-image-tools-wm/android/src/main/java/net/wowmaking/Utility.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
15 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-image-tools-wm:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
@alanwong0922
Copy link
Author

Here the some update for build the andorid

After following this post
#27

The application success to build but it return the error
[getPackages() method in MainApplication.java, the module might be created twice]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant