react native fetch function not working after build and run on real android 11 devices and above #31993
Labels
Needs: Attention
Issues where the author has responded to feedback.
Platform: Android
Android applications.
Resolution: Locked
This issue was locked by the bot.
as the title says, the app(fetching data from server) is running well on real android device(android 11 below), when i running app on real android 11, 12 the app is not working. i dont know why, all build, code, nothing get error.
here the build result on command promt
Configuration on demand is an incubating feature.
info Writing bundle output to:, D:\Programming\MobileApp\semerbak\Semerbak\android\app\build\generated\assets\react\release\index.android.bundle
info Writing sourcemap output to:, D:\Programming\MobileApp\semerbak\Semerbak\android\app\build\generated\sourcemaps\react\release\index.android.bundle.map
info Done writing sourcemap output
info Done writing bundle output
info Copying 18 asset files
info Done copying assets
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 12m 51s
413 actionable tasks: 6 executed, 407 up-to-date
i also change my buid.gradle on root/android/build.gradle, android 11 api level (api 30)
ext {
i also use latest stable version react native on this time(0.64.2), here the 'react-native info' result
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.19041
CPU: (4) x64 Intel(R) Core(TM) i3-5005U CPU @ 2.00GHz
Memory: 1.02 GB / 3.92 GB
Binaries:
Node: 16.4.0 - D:\NodeJs\node.EXE
Yarn: Not Found
npm: 7.18.1 - D:\NodeJs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.3
System Images: android-23 | Google APIs Intel x86 Atom, android-24 | ARM EABI v7a, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Not Found
Visual Studio: 15.3.26730.8 (Visual Studio Enterprise 2017)
Languages:
Java: 1.8.0_282
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.2 => 0.64.2
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
Steps To Reproduce
cd android
and thengradlew assembleRelease
Expected Results
here is the expected result on real android device (below android 11)
and here result on android 11
i also tried axios, but as you can see in screenshot android 11, axios not return anything
here code
App = () =>{
const [axiosResponse, setAxiosResponse] = React.useState('');
const [fetchResponse, setFetchResponse] = React.useState('');
const [jsonFetchResponse, setJsonFetchResponse] = React.useState('');
const axiosfetch = async () => {
};
const fetching = () => {
};
return(
<View style={{flex:1, backgroundColor:'black'}} >
<TouchableOpacity
onPress={()=>axiosfetch()}
style={{
backgroundColor:'white',
paddingHorizontal: 15,
paddingVertical:2,
}}
>
AXIOS
<Text style={{color:'white', fontSize:16, marginBottom:25}} >AXIOS: <Text style={{color:GLOBAL.COLOR.LIGHTBLUE, fontSize:16}} >{axiosResponse}
);
}
//export default
export default App;
The text was updated successfully, but these errors were encountered: