我正在尝试成功运行./gradlew assembleRelease
,但是出现以下错误:
> Task :react-native-immediate-phone-call:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-immediate-phone-call:verifyReleaseResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
我已经遵循了文档,但是我想知道它是否不正确。
例如,我的MainApplication.java
文件是否存在此问题:
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 ReactNativeOneSignalPackage());
packages.add(new RNSentryPackage());
packages.add(new RNDeviceInfo());
packages.add(new SplashScreenReactPackage());
packages.add(new RNImmediatePhoneCallPackage());
packages.add(new SwipeViewPackage());
return packages;
}
我是否拥有RN 0.60.4所需的资源?
答案 0 :(得分:2)
要摆脱com.android.builder.internal.aapt.v2.Aapt2Exception
,您必须修改以下文件:
node_modules / react-native-immediate-phone-call / android / build.gradle
将compileSdkVersion
更改为28
将targetSdkVersion
更改为27