Closed dorapax-lab closed 3 years ago
What was the solution for this ? i'm having the same problem
Or actually never mind , the solution was to add to /android/app/build.gradle inside the defaultConfig tag this line :
{ missingDimensionStrategy 'store', 'play' }
the solution was to add to /android/app/build.gradle inside the defaultConfig tag this line :
missingDimensionStrategy ('store', 'play')
Hi guys! Ok, I had the same issue and this worked, but why is this necessary? Should this remain on production build?
Thanks in advance.
the solution was to add to /android/app/build.gradle inside the defaultConfig tag this line :
missingDimensionStrategy ('store', 'play')
This worked for me thanks.
Someone, please explain the idea behind this https://github.com/dooboolab/react-native-iap/issues/1373#issuecomment-905789392.
Someone, please explain the idea behind this #1373 (comment).
6.10.0 adds two variants on android: google play and amazon app store. This is a fallback to google play if you haven't specified a build variant otherwise.
Does anyone know how to fix this issue an expo managed project where the build.gradle is not available to edit so easily?
Has anyone found out how to edit the build.gradle in managed workflow ??? I'd really need a solution for it
Has anyone found out how to edit the build.gradle in managed workflow ??? I'd really need a solution for it
if you are using expo's managed workflow , i think it would better to switch to bare workflow , it might need a little more configuration , but at least you don't have to deal with situations like these.
but if you want to continue working with managed workflow, you can make native changes to the managed workflow using Expo Config Plugins starting from SDK 41.
a config plugin is basically a JavaScript function that reads and edits a native file such as Android manifest, Gradle config, IOS Infoplist.
Good luck.
but if you want to continue working with managed workflow, you can make native changes to the managed workflow using Expo Config Plugins starting from SDK 41.
Thanks !!!!
I got it to work using a managed workflow.
Here is the code for it if anyone has the same issue :
/plugins/withAndroidStrategiesPlugin.js
const { withAppBuildGradle } = require('@expo/config-plugins');
module.exports = function withAndroidStrategiesPlugin(config) {
return withAppBuildGradle(config, (config) => {
config.modResults.contents +=
'android { defaultConfig { missingDimensionStrategy "store", "play" } }';
return config;
});
};
/app.json
{
"expo": {
[...]
"plugins": [
"./plugins/withAndroidStrategiesPlugin.js",
"react-native-iap",
]
}
}
If you build the APK locally, don't forget to run npx expo prebuild
beforehand.
Otherwise eas build
does it on its own.
That worked for me! Thanks! Adding below line: missingDimensionStrategy 'store', 'play'
maybe this should be added to FAQ, wiki or onboarding steps?
npx expo prebuild fixed my issue
also, i am using react native in bare for nearly 2 years, i wanted to try develop an app in expo
and i hate it already but project got so big that i dont want to eject expo so nothing breaks wont going to use it again
One might encounter "Cannot invoke method android() on null object"
using @axelmy318's solution (which did work before for some reason). This is because of a new line that should be added on top of the plugin (similar to this):
const { withAppBuildGradle } = require("@expo/config-plugins");
module.exports = function withAndroidStrategiesPlugin(config) {
return withAppBuildGradle(config, (config) => {
config.modResults.contents += `
android { defaultConfig { missingDimensionStrategy "store", "play" } }`;
return config;
});
};
Could not resolve project :react-native-iap: Could not determine the dependencies of task ':app:mergeAlaccountingmodelmcqenudeDebugAssets'.
Version of react-native-iap
6.2.0
Version of react-native
0.63.4
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
project should be build.
Actual behavior
Getting below error and build is failing.
Ran
./gradlew app:installMyapppackageDebug -PreactNativeDevServerPort=8081 --stacktrace
Tested environment (Emulator? Real Device?)
Real Device
Steps to reproduce the behavior
expo eject
yarn android