Commit Graph

44 Commits

Author SHA1 Message Date
tsrkalexandr 1ea804593b Fix file:// scheme on Android. (#345) 2018-11-13 12:41:15 -05:00
Patrick Kempff 7859d5b6d9 Improve error message when bundled resource could not found. (#328)
A team member of mine spend a couple of hours debugging this error:
Couldn't find com.facebook.react.uimanager.annotations.ReactProp.source.

There was no clear indicator of what the underlaying problem was. As it turns out the error was caused by missing assets. To make sure other developers don't waste the same amount of time as we did, we improved the error message.
2018-11-06 01:16:31 -05:00
Dylan Vann f8606a1f2e
Fix android photo library images not working. (#339) 2018-11-06 01:07:28 -05:00
Dylan Vann 47e36edc24
Fix local images in production builds. (#324)
* Revert changes to make yarn link work.

* Fixed local images in production builds.

This closes #273, closes #296, closes #246.

* Remove unused code and fix some warnings.
2018-10-23 00:58:35 -04:00
Patrick Kempff 8f702ed1d9 Fixed crash where activity was already destroyed before react-native could cleanup view manager 2018-10-21 20:37:16 -04:00
(◕ᴥ◕) 75a6ce766c Handle null view.glideUrl. 2018-09-23 17:54:24 -04:00
Dylan Vann a3b581014d Fix build.gradle. 2018-09-23 16:36:46 -04:00
Danish 649e9a8edf Update obsolete compile to implementation and Exclude app dependencies from test configurations (#250)
FIRST OF ALL, I am using this package from npm so I saw that the git repo one commit ahead that is this one f31a44fc07 (diff-7ae5a9093507568eabbf35c3b0665732) where you upgrade to glide 4 with progress listeners. I couldn't submit PR for the version I am using from NPM. so as of now explain of this PR is as follow:


As React native 0.56.0 is released with MAJOR android changes such as:

-Gradle 3.5.1
-Compile using Android SDK 26
-Google Maven repo
-etc

more about Change log, specially of Android Here, https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#android-projects-are-now-compiled-using-the-android-26-sdk
and https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#android-specific-changes

Aslo as Per Google new "Google Play's target API level requirement", mentioned here  https://developer.android.com/distribute/best-practices/develop/target-sdk

"Google Play will require that new apps target at least Android 8.0 (API level 26) from August 1, 2018, and that app updates target Android 8.0 from November 1, 2018."

It's clear that Android would be moving to new Gradle and new SDK changes, Thus creating a new type of error that is:

"Configuration 'compile' is obsolete and has been replaced with 'implementation' or 'Api'" 

more about the Old and new configuration please see this https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration?utm_source=android-studio#new_configurations 
at the heading of "Use the new dependency configurations"

Therefore, all old "compile" should be now "implementation" or "provided" should be "compileOnly"

I have tested the with "compile" and "implementation" in my current release ready product and also by "renaming" "compile" to "implementation".
Also tested with higher andorid SDK configs such as of below:

```
ext {
    buildToolsVersion = "27.0.3"
    minSdkVersion = 19
    compileSdkVersion = 27
    targetSdkVersion = 27
    supportLibVersion = "27.1.1"
}
```

so SDK 27 was also compiled successully. test on Android phone with ADK 23 all looks good. Thus, `react-native-fast-image` was working just fine as intended. thank you so much for this package btw.

Therefore, Please would it be possible to merge as i am sure many new projects and old one are going to update specially Gradle and SDK as of Google new requirements. 

related mention of Upgrading issue mention here https://github.com/facebook/react-native/issues/20273#issuecomment-405959030


Moreover, if someone still have any issue after upgrading everything successfully, then he should use following in build.gradle under `andorid/build.gradle`

```

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 27
                buildToolsVersion '27.0.3'
                supportLibVersion = "27.1.1"
            }
        }
    }
}
```


PS: as of exclude part in your build.grade, I am not 100% it will work for example mine app has something like this

compile project((':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
compile 'com.google.android.gms:play-services-base:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'


after converting this to


implementation project(':react-native-maps')
 android.testVariants.all { variant ->
        variant.getCompileConfiguration().exclude group: 'com.google.android.gms', module: 'play-services-base'
        variant.getRuntimeConfiguration().exclude group: 'com.google.android.gms', module: 'play-services-base'

        variant.getCompileConfiguration().exclude group: 'com.google.android.gms', module: 'play-services-maps'
        variant.getCompileConfiguration().exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation 'com.google.android.gms:play-services-base:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'


everything is working fine for me. so please have a look for your just in case.
2018-09-23 16:33:31 -04:00
Danish 5d973a8cec Update obsolete compile to implementation and Exclude app dependencies from test configurations.
FIRST OF ALL, I am using this package from npm so I saw that the git repo one commit ahead that is this one f31a44fc07 (diff-7ae5a9093507568eabbf35c3b0665732) where you upgrade to glide 4 with progress listeners. I couldn't submit PR for the version I am using from NPM. so as of now explain of this PR is as follow:

As React native 0.56.0 is released with MAJOR android changes such as:

-Gradle 3.5.1
-Compile using Android SDK 26
-Google Maven repo
-etc

more about Change log, specially of Android Here, https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#android-projects-are-now-compiled-using-the-android-26-sdk
and https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#android-specific-changes

Aslo as Per Google new "Google Play's target API level requirement", mentioned here  https://developer.android.com/distribute/best-practices/develop/target-sdk

"Google Play will require that new apps target at least Android 8.0 (API level 26) from August 1, 2018, and that app updates target Android 8.0 from November 1, 2018."

It's clear that Android would be moving to new Gradle and new SDK changes, Thus creating a new type of error that is:

"Configuration 'compile' is obsolete and has been replaced with 'implementation' or 'Api'"

more about the Old and new configuration please see this https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration?utm_source=android-studio#new_configurations
at the heading of "Use the new dependency configurations"

Therefore, all old "compile" should be now "implementation" or "provided" should be "compileOnly"

I have tested the with "compile" and "implementation" in my current release ready product and also by "renaming" "compile" to "implementation".
Also tested with higher andorid SDK configs such as of below:

```
ext {
    buildToolsVersion = "27.0.3"
    minSdkVersion = 19
    compileSdkVersion = 27
    targetSdkVersion = 27
    supportLibVersion = "27.1.1"
}
```

so SDK 27 was also compiled successully. test on Android phone with ADK 23 all looks good. Thus, `react-native-fast-image` was working just fine as intended. thank you so much for this package btw.

Therefore, Please would it be possible to merge as i am sure many new projects and old one are going to update specially Gradle and SDK as of Google new requirements.

related mention of Upgrading issue mention here https://github.com/facebook/react-native/issues/20273#issuecomment-405959030

Moreover, if someone still have any issue after upgrading everything successfully, then he should use following in build.gradle under `andorid/build.gradle`

```

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 27
                buildToolsVersion '27.0.3'
                supportLibVersion = "27.1.1"
            }
        }
    }
}
```

PS: as of exclude part in your build.grade, I am not 100% it will work for example mine app has something like this

compile project((':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
compile 'com.google.android.gms:play-services-base:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'

after converting this to

implementation project(':react-native-maps')
 android.testVariants.all { variant ->
        variant.getCompileConfiguration().exclude group: 'com.google.android.gms', module: 'play-services-base'
        variant.getRuntimeConfiguration().exclude group: 'com.google.android.gms', module: 'play-services-base'

        variant.getCompileConfiguration().exclude group: 'com.google.android.gms', module: 'play-services-maps'
        variant.getCompileConfiguration().exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation 'com.google.android.gms:play-services-base:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'

everything is working fine for me. so please have a look for your just in case.
2018-09-23 16:28:34 -04:00
Sam Oh efd02a307d Add missing breaks in converter. 2018-09-23 01:56:53 -04:00
Dylan Vann b504131083 Use supportLibVersion from ext. 2018-08-23 13:43:27 -04:00
Dylan Vann 93b59295ce Fix android build.gradle. 2018-08-23 13:36:25 -04:00
Dylan Vann 9f422c4a74 Add cache control for Android. 2018-06-14 22:40:10 -04:00
Dylan Vann fddee2c583
Show local images.
Show local images on iOS and Android.
2018-06-09 22:12:56 -04:00
Patrick Kempff 6e0e6f8f2b Fixed memory leaks (#214) 2018-06-07 23:22:57 -04:00
Dylan Vann f31a44fc07
Upgrade to glide 4 with progress listeners working. (#201) 2018-05-10 02:40:04 -04:00
Dylan Vann 1edb6fd76a Remove unused imports. 2018-05-08 16:24:36 -04:00
Dylan Vann a4e6ef3002 Revert increasing buildToolsVersion and targetSdkVersion. 2018-05-06 03:47:33 -04:00
Dylan Vann 52ccc8ce9a Revert change to android manifest. 2018-05-06 03:44:02 -04:00
Dylan Vann bf67634a44 Fix android project. 2018-05-06 03:39:22 -04:00
Dylan Vann 1cbc838e33
Merge pull request #101 from btegenbosch/hotfix/use-okhttpclient-provider
Use OkHttpClientProvider to allow extending preconfigured clients.
2018-05-03 12:17:55 -04:00
Dylan Vann be1564fe54 Invert if to reduce nesting. 2018-04-24 22:57:26 -04:00
Dylan Vann 599abfafaa
Merge pull request #172 from Kouznetsov/master
Added null check on  getCurrentActivity()'s return value.
2018-04-24 22:54:57 -04:00
Rayron Victor bbdfd33aaf Using SDK Version variables from root project
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project.
Default `compileSdkVersion` and `targetSdkVersion` to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095
2018-04-24 14:56:37 -03:00
Karim Harat 6099d91c23 Added null check on getCurrentActivity()'s return value 2018-03-27 11:18:05 +02:00
Til Wessel efbb1c2dd5 set the GlideBuilder to use higher quality decoding 2018-03-14 10:47:18 +01:00
Dylan Vann 8279ecda47
Merge pull request #107 from jeremyclee/resource-info-onloadend
Added resource width and height information to the onFastImageLoad an…
2018-03-11 19:35:21 -04:00
Dylan Vann d4210c0ed0 Fix default resizeMode on Android. 2018-01-30 22:04:33 -05:00
Dylan Vann de4f40a3a3 Fix android caching / preloading. 2018-01-30 21:54:22 -05:00
Bart Tegenbosch e657a168e8 Added missing OkHttpClientProvider import. 2018-01-29 21:03:08 +01:00
Jeremy Lee 6c1d1f805b fixed error with submitting the same map to the event emitter 2018-01-03 14:20:44 -08:00
Jeremy Lee eae1c7a486 Added resource width and height information to the onFastImageLoad and onFastImageLoadEnd events 2017-12-12 13:34:29 -08:00
Bart Tegenbosch eac670b2dc Use OkHttpClientProvider to allow extending preconfigurated clients. 2017-12-07 23:47:36 +01:00
Dylan Vann b45acef707 Merge branch 'master' into wz366-master
# Conflicts:
#	package.json
2017-11-29 22:34:02 -05:00
Wes Zheng 8859f63041 use application context to avoid deallocated view error when split screen on android 2017-10-20 10:40:06 -07:00
Ted de Koning c2bcb78fac Image resizing - Fixing resizemode support. 2017-09-15 16:38:34 +02:00
Dylan Vann f21522c409 Fix adding more views as listeners for a URL.
You cannot add items to a Collections.singleTonList...
2017-08-07 23:53:24 -04:00
Aaron Taylor 367024bcbd Remove override of createJSModules
Since of recently in master the unused createJSModules has been removed and ReactPackage's no longer contain the definition of createJSModules. There for it must be removed in order to not yield a compile error. This is breaking change.

facebook/react-native@ce6fb33
2017-08-07 23:24:59 -04:00
Dylan Vann aa6c1836e7 Fix android progress events. 2017-07-26 21:57:15 -04:00
Dylan Vann 1666f7c4e5 Make android and iOS view loading events conform to API of React Native's Image.
This will make using this library as a drop in replacement easier.
This commit also fixes some issues in the android progress implementation.
2017-07-25 00:44:08 -04:00
Dylan Vann c643347d4c Add android progress callback. 2017-07-05 04:10:21 -04:00
Dylan Vann 46e08b46e2 Update to support preloading sources.
Sources for preloading have the same keys as the source prop.
Also update readme to document preloading.
2017-06-20 03:10:56 -04:00
Flávio Caetano 4c87fc0337 Enables prefetching images 2017-06-08 18:52:59 -03:00
Dylan Vann 1ee6d37bd4 🚩 Initial commit. 2017-04-17 18:42:16 -04:00