alwx / react-native-photo-view

Pinch-to-zoom view for React Native (both iOS and Android)
MIT License
816 stars 434 forks source link

Can't build after updating to RN 56 - Execution failed for task ':react-native-photo-view:verifyReleaseResources' #166

Open ds8k opened 5 years ago

ds8k commented 5 years ago

I'm unable to generate a release build after upgrading to React Native 56:

:react-native-photo-view:verifyReleaseResources/Users/user/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/d966a29d4964b9817b018d8a3a1d16a4/res/values-v24/values-v24.xml:3:5-157: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

/Users/user/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/d966a29d4964b9817b018d8a3a1d16a4/res/values-v24/values-v24.xml:4:5-135: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

/Users/user/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/d966a29d4964b9817b018d8a3a1d16a4/res/values-v26/values-v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-photo-view:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

Looks like compileSdkVersion, buildToolsVersion, and targetSdkVersion in build.gradle need to be updated. They're pointing to old versions right now:

android {
    compileSdkVersion 23
    buildToolsVersion "25.0.0"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
    }
    lintOptions {
        abortOnError false
    }
}
zarcode commented 5 years ago

I got the similar issue on new RN 0.56 project:

* What went wrong:
Execution failed for task ':react-native-photo-view:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

build.gradle:

ext {
    buildToolsVersion = "26.0.3"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"
}
stephenheron commented 5 years ago

Yeah seeing the same here.

I manually bumped the compileSdkVersion to 26 in the build.gradle and that got it to compile.

tomtom94 commented 5 years ago

Yeah seeing the same here.

I manually bumped the compileSdkVersion to 26 in the build.gradle and that got it to compile.

You can't change a module like that. This module needs to be updated !!!

I got the same issue !

stephenheron commented 5 years ago

Yeah seeing the same here. I manually bumped the compileSdkVersion to 26 in the build.gradle and that got it to compile.

You can't change a module like that. This module needs to be updated !!!

I got the same issue !

Not the best solution I agree, but if you use something like https://www.npmjs.com/package/patch-package you can at least get on with your project while waiting for a update.

ghost commented 5 years ago

+1

tomtom94 commented 5 years ago

I made a fork with the PR modifications here https://github.com/alwx/react-native-photo-view/pull/174 you can now install correctly this module with my fork https://github.com/tomtom94/react-native-photo-view

"dependencies": {
  "react-native-photo-view": "git+https://github.com/tomtom94/react-native-photo-view.git"
}

or

npm i https://github.com/tomtom94/react-native-photo-view.git

thecodecafe commented 5 years ago

Wasn't this resolved? Currently experiencing it on RN 0.59.0.

tomtom94 commented 5 years ago

No the solution is you make a fork and change it yourself, or use straight my own fork https://github.com/tomtom94/react-native-photo-view cheers

Abewkayew commented 4 years ago

@ds8k: You should take the following changes:

Go to react-native-photo-view/android/build.gradle Change:

> compileSdkVersion 23
>     buildToolsVersion "23.0.3"
> 
>     defaultConfig {
>         minSdkVersion 16
>         targetSdkVersion 23
>         versionCode 1
>     }

to

> compileSdkVersion 28
>     buildToolsVersion "28.0.3"
> 
>     defaultConfig {
>         minSdkVersion 16
>         targetSdkVersion 28
>         versionCode 1
>     }
YBrown-JM commented 3 years ago

Though fixed in git, the npm repository is still dated 3Y ago. As a workaround, I set in package.json:

    "react-native-photo-view": "github:alwx/react-native-photo-view#ef532a34829729ce3153628754d434bd646bcc6d",

for the last build.

rum-n commented 1 year ago

Currently having the same issue on RN 0.63. Changing package.json manually didn't work, unfortunately. Did anyone figure this out?

sungsong88 commented 1 year ago

I'm still having the same issue. Feb 21, 2023.

My Project has the latest react-native-photo-view like this:

"react-native-photo-view": "github:alwx/react-native-photo-view"

And when I ran ./gradlew assembleRelease at first, I saw Could not find me.relex:photodraweeview:1.1.3 so I fixed it by following https://github.com/alwx/react-native-photo-view/issues/209#issuecomment-1158386189

And then I ran ./gradlew assembleRelease again, but this time saw something else react native build error: package android.support.annotation does not exist so I fixed it using jetifier by following the instructions here: https://stackoverflow.com/questions/56667264/react-native-build-error-package-android-support-annotation-does-not-exist

And then I ran ./gradlew assembleRelease again, but this time saw something else again react-native-photo-view:verifyReleaseResources. And none of the solutions above worked for me. It says

> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/andre/work/my_project/node_modules/react-native-photo-view/android/build/intermediates/merged_res/release/values/values.xml:2722: AAPT: error: resource android:attr/lStar not found.

This is such a great package, but so sad that it's so hard to use with the latest Expo SDK47. it works like a charm only for iOS...

sungsong88 commented 1 year ago

Okay, this is weird. Now it works when I run ./gradlew app:assembleRelease instead of ./gradlew assembleRelease