Comments (13)
Hmmm, so from RN 60 upwards if you do not link packages they still work?
I did not find time to experiment and read what changed in RN 60... but if not linking packages fixes issues than I should mention this in the readme of all my published packages!
(I really hope RN gets mature quickly and does not change package imports anymore, that is a real pain in the ass for package publishers! They should increase major version number for every breaking change if you'd ask me, that would make it easy to spot possible issues and make migration guides!)
from react-native-immediate-phone-call.
Having the same issue on RN 0.60.5.
Edit: I have managed to fix this issue by patching node_modules/react-native-immediate-phone-call/android/build.gradle
compileSdkVersion to 28 and targetSdkVersion to 27
Other than that Mainapplication.java and Mainactivity.java are left untouched (don't follow the readme for RN 0.60, the autolinking feature takes care of everything)
For the patching just use https://github.com/ds300/patch-package to avoid having to manually patch it after every yarn install.
Hope this helps @arrygoo
from react-native-immediate-phone-call.
I have the same issue :( Tried a bunch of solutions but nothing works
from react-native-immediate-phone-call.
@arrygoo ,
This configuration worked for me:
package com.nfibengage;
import android.app.Application;
import android.util.Log;
import com.facebook.react.PackageList;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.ReactApplication;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.wix.RNSwipeView.SwipeViewPackage;
// import com.microsoft.appcenter.reactnative.crashes.AppCenterReactNativeCrashesPackage;
// import com.microsoft.appcenter.reactnative.analytics.AppCenterReactNativeAnalyticsPackage;
// import com.microsoft.appcenter.reactnative.appcenter.AppCenterReactNativePackage;
import com.geektime.rnonesignalandroid.ReactNativeOneSignalPackage;
import io.sentry.RNSentryPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import com.github.wumke.RNImmediatePhoneCall.RNImmediatePhoneCallPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(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 AppCenterReactNativeCrashesPackage(MainApplication.this, getResources().getString(R.string.appCenterCrashes_whenToSendCrashes)));
// packages.add(new AppCenterReactNativeAnalyticsPackage(MainApplication.this, getResources().getString(R.string.appCenterAnalytics_whenToEnableAnalytics)));
// packages.add(new AppCenterReactNativePackage(MainApplication.this));
packages.add(new ReactNativeOneSignalPackage());
packages.add(new RNSentryPackage());
packages.add(new RNDeviceInfo());
new SplashScreenReactPackage();
packages.add(new RNImmediatePhoneCallPackage());
packages.add(new SwipeViewPackage());
return packages;
}
Try the above, if you still have problems, at least you will know that its not your MainApplication.java
because the above works. Best of luck.
from react-native-immediate-phone-call.
Sadly that didn't work for me :(
from react-native-immediate-phone-call.
@arrygoo , your issue is elsewhere in your code then. The configuration above is solid. Ensure you do a gradle clean as well.
from react-native-immediate-phone-call.
@Unforgiven-wanda ,
I am getting this error again when I attempt to generate apk
vial assembleRelease
, but it does not give me the error when I run bundleRelease
.
I tried your patch-package and it did not work either.
Now are you suggesting that we do not need this for RN 60.4?
import com.github.wumke.RNImmediatePhoneCall.RNImmediatePhoneCallPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(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 ReactNativeOneSignalPackage());
packages.add(new RNSentryPackage());
packages.add(new RNDeviceInfo());
packages.add(new SplashScreenReactPackage());
packages.add(new RNImmediatePhoneCallPackage());
packages.add(new SwipeViewPackage());
return packages;
}
from react-native-immediate-phone-call.
Here is my working MainApplication.java
package com.igniteandross;
import android.app.Application;
import android.util.Log;
import com.facebook.react.PackageList;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(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());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
You'll notice I do not import RNImmediatePhoneCallPackage
and it works fine, even with assembleRelease
in my case.
My MainActivity.java
package com.igniteandross;
import com.calendarevents.CalendarEventsPackage;
import android.os.Bundle;
import com.facebook.react.ReactFragmentActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
public class MainActivity extends ReactFragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "igniteAndross";
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
CalendarEventsPackage.onRequestPermissionsResult(requestCode, permissions, grantResults);
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
from react-native-immediate-phone-call.
@Unforgiven-wanda ,
I completely removed react-native-immediate-phone-call
, unlinked it from android. cleaned my project, removed it from MainApplication.java
and reinstalled it and I am still getting that same error.
Should I also remove it from build.gradle
and any other files in android?
from react-native-immediate-phone-call.
@ldco2016 @Unforgiven-wanda
Same, I still get the same error.
I tried @Unforgiven-wanda's solution of updating sdk versions, but it causes the app to crash on open
from react-native-immediate-phone-call.
I've found https://github.com/react-native-community/cli/blob/master/docs/autolinking.md which tells us to unlink it... but I think you should also remove it from the build.gradle then (like @ldco2016 suggests)
OR (I've read but not tested) you can exclude this package from autolinking and link it the old way, scroll all the way down on the link page.
Let me know what worked, and what did not. Together we will figure it out ;-)
from react-native-immediate-phone-call.
To get rid of com.android.builder.internal.aapt.v2.Aapt2Exception
you have to modify the following file:
node_modules/react-native-immediate-phone-call/android/build.gradle
change compileSdkVersion to 28
change targetSdkVersion to 27
from react-native-immediate-phone-call.
@ldco2016 That solution fixes the build for me but causes the app to crash on open :(
from react-native-immediate-phone-call.
Related Issues (20)
- Attempt to invoke virtual method 'android.content.Context android.content.ContextWrapper.getApplicationContext()' on a null object reference HOT 9
- Call in background HOT 2
- Error when trying generating APK HOT 4
- error: cannot find symbol HOT 8
- Old version in npm HOT 2
- Error: Unable to find symbol HOT 2
- RN 61 pod support HOT 3
- Nothing happening when calling RNImmediatePhoneCall.immediatePhoneCall() HOT 16
- How to get callback function after calling HOT 2
- Nothing happens after calling the function to initiate call HOT 3
- Getting 'null is not an object' when trying to call HOT 5
- IOS opening confirm popup for call HOT 4
- Does react-native-immediate-phone-call disable network connection when make a phone call HOT 1
- Immediate call is not working when application is in background on Android HOT 1
- how to handle errors after calling HOT 1
- Please add types HOT 1
- Failed to build iOS project HOT 1
- How can I change from audio to video call. HOT 1
- Is there any way to have custom UI (containing call accept and reject buttons) when the phone call is invoked? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-immediate-phone-call.