после установки response-native-fbsdk и создания response-native link мой проект android не будет синхронизироваться правильно, в результате появится следующая ошибка:
The module 'react-native-fbsdk' is an Android project without build variants,
and cannot be built.
Please fix the module's configuration in the build.gradle file and sync the project again.
Environment
Environment:
OS: macOS 10.14.1
Node: 8.11.3
Yarn: 1.9.4
npm: 5.6.0
Xcode: Xcode 10.0 Build version 10A255
Android Studio: 3.2 AI-181.5540.7.32.5056338
Packages: (wanted => installed)
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: https://github.com/expo/react-native/archive/sdk-26.0.0.tar.gz => 0.54.2
при попытке построить проект я получаю сообщение об ошибке mainActivity о com.facebook.reactnative.FBSDKPackage, поэтому мое приложение не будет создано.
Я не разработчик Android, поэтому я не уверен, что следующий шаг.я уже пытаюсь сделать file-> invalidate-caches restart .но это не сработало вообще.
это мой файл app / gradle.build:
<code>
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
mavenCentral()
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.10.0, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.neenbedankt.android-apt'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId 'com.trixel.cobru'
targetSdkVersion 25
versionCode 2
versionName '0.1.0'
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Deprecated. Used by net.openid:appauth
manifestPlaceholders = [
'appAuthRedirectScheme': 'host.exp.exponent'
]
}
dexOptions {
javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
}
productFlavors {
// Define separate dev and prod product flavors.
dev {
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
minSdkVersion 21
}
devRemoteKernel {
minSdkVersion 21
}
dev19 {
// For debugging / development on older SDK versions. Increases build
// time so use 'dev' if not running on older SDKs.
minSdkVersion 19
}
prod {
// The actual minSdkVersion for the application.
minSdkVersion 19
}
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
}
prod {
}
}
lintOptions {
abortOnError false
}
packagingOptions {
pickFirst "**"
}
}
// Don't use modern jsc-android since it still has some critical bugs that
// crash applications when the string for the JS bundle is loaded and when
// locale-specific date functions are called.
// configurations.all {
// resolutionStrategy {
// force 'org.webkit:android-jsc:r216113'
// }
// }
task exponentPrebuildStep(type: Exec) {
workingDir '../'
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
commandLine 'cmd', '/c', '.\\detach-scripts\\prepare-detached-build.bat'
} else {
commandLine './detach-scripts/prepare-detached-build.sh'
}
}
preBuild.dependsOn exponentPrebuildStep
dependencies {
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile project(':react-native-fbsdk')
compile project(':react-native-onesignal')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
// Our dependencies
compile 'com.android.support:appcompat-v7:26.0.1'
// Our dependencies from ExpoView
// DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
compile 'com.android.support:appcompat-v7:26.0.1'
compile('com.facebook.android:audience-network-sdk:4.22.1') {
exclude module: 'play-services-ads'
}
provided 'org.glassfish:javax.annotation:3.1.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.amplitude:android-sdk:2.9.2'
// Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services-gcm:9.8.0'
compile 'com.google.android.gms:play-services-analytics:9.8.0'
compile 'com.google.android.gms:play-services-maps:9.8.0'
compile 'com.google.android.gms:play-services-auth:9.8.0'
compile 'com.google.android.gms:play-services-location:9.8.0'
compile 'com.google.android.gms:play-services-ads:9.8.0'
apt 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
compile 'com.raizlabs.android:DBFlow-Core:2.2.1'
compile 'com.raizlabs.android:DBFlow:2.2.1'
compile 'com.madgag.spongycastle:core:1.53.0.0'
compile 'com.madgag.spongycastle:prov:1.53.0.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
compile 'com.facebook.device.yearclass:yearclass:1.0.1'
compile 'commons-io:commons-io:1.3.2'
compile 'me.leolin:ShortcutBadger:1.1.4@aar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
compile 'com.yqritc:android-scalablevideoview:1.0.1'
compile 'commons-codec:commons-codec:1.10'
compile 'com.segment.analytics.android:analytics:4.3.0'
compile 'com.google.zxing:core:3.2.1'
compile 'net.openid:appauth:0.4.1'
compile 'com.airbnb.android:lottie:2.2.0'
compile 'io.branch.sdk.android:library:2.6.1'
compile('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
compile 'com.android.support:exifinterface:26.0.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
compile 'com.squareup.okhttp3:okhttp-ws:3.4.1'
compile 'com.squareup.okio:okio:1.9.0'
// Testing
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support:support-annotations:26.0.1'
androidTestCompile 'com.google.code.findbugs:jsr305:3.0.0'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestCompile 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
compile('host.exp.exponent:expoview:26.0.0@aar') {
transitive = true
}
}
// This has to be down here for some reason
//apply plugin: 'com.google.gms.google-services'
</code>
это мой settings.gradle:
include ':app'
include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')
include ':react-native-onesignal'
project(':react-native-onesignal').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-onesignal/android')
так что я могу сделать, чтобы получить проектчтобы синхронизировать, как мне добавить «варианты сборки», нужно ли мне редактировать файл gradle проекта android в папке модулей узла reat-native-fbsdk?
любая помощь приветствуется.
Редактировать
это вывод команды ./gradlew tasks
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
Parallel execution with configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:tasks
------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------
Android tasks
-------------
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for each variant.
sourceSets - Prints out all the source sets defined in this project.
Build tasks
-----------
assemble - Assembles all variants of all applications and secondary packages.
assembleAndroidTest - Assembles all the Test applications.
assembleDebug - Assembles all Debug builds.
assembleDev - Assembles all Dev builds.
assembleDev19 - Assembles all Dev19 builds.
assembleDevRemoteKernel - Assembles all DevRemoteKernel builds.
assembleProd - Assembles all Prod builds.
assembleRelease - Assembles all Release builds.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileDev19DebugAndroidTestSources
compileDev19DebugSources
compileDev19DebugUnitTestSources
compileDev19ReleaseSources
compileDev19ReleaseUnitTestSources
compileDevDebugAndroidTestSources
compileDevDebugSources
compileDevDebugUnitTestSources
compileDevReleaseSources
compileDevReleaseUnitTestSources
compileDevRemoteKernelDebugAndroidTestSources
compileDevRemoteKernelDebugSources
compileDevRemoteKernelDebugUnitTestSources
compileDevRemoteKernelReleaseSources
compileDevRemoteKernelReleaseUnitTestSources
compileProdDebugAndroidTestSources
compileProdDebugSources
compileProdDebugUnitTestSources
compileProdReleaseSources
compileProdReleaseUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources
extractDebugAnnotations - Extracts Android annotations for the debug variant into the archive file
extractReleaseAnnotations - Extracts Android annotations for the release variant into the archive file
mockableAndroidJar - Creates a version of android.jar that's suitable for unit tests.
Build Setup tasks
-----------------
init - Initializes a new Gradle build. [incubating]
wrapper - Generates Gradle wrapper files. [incubating]
Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'android'.
components - Displays the components produced by root project 'android'. [incubating]
dependencies - Displays all dependencies declared in root project 'android'.
dependencyInsight - Displays the insight into a specific dependency in root project 'android'.
dependentComponents - Displays the dependent components of components in root project 'android'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'android'. [incubating]
projects - Displays the sub-projects of root project 'android'.
properties - Displays the properties of root project 'android'.
tasks - Displays the tasks runnable from root project 'android' (some of the displayed tasks may belong to subprojects).
Install tasks
-------------
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
installDev19Debug - Installs the DebugDev19 build.
installDev19DebugAndroidTest - Installs the android (on device) tests for the Dev19Debug build.
installDevDebug - Installs the DebugDev build.
installDevDebugAndroidTest - Installs the android (on device) tests for the DevDebug build.
installDevRemoteKernelDebug - Installs the DebugDevRemoteKernel build.
installDevRemoteKernelDebugAndroidTest - Installs the android (on device) tests for the DevRemoteKernelDebug build.
installProdDebug - Installs the DebugProd build.
installProdDebugAndroidTest - Installs the android (on device) tests for the ProdDebug build.
uninstallAll - Uninstall all applications.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallDev19Debug - Uninstalls the DebugDev19 build.
uninstallDev19DebugAndroidTest - Uninstalls the android (on device) tests for the Dev19Debug build.
uninstallDev19Release - Uninstalls the ReleaseDev19 build.
uninstallDevDebug - Uninstalls the DebugDev build.
uninstallDevDebugAndroidTest - Uninstalls the android (on device) tests for the DevDebug build.
uninstallDevRelease - Uninstalls the ReleaseDev build.
uninstallDevRemoteKernelDebug - Uninstalls the DebugDevRemoteKernel build.
uninstallDevRemoteKernelDebugAndroidTest - Uninstalls the android (on device) tests for the DevRemoteKernelDebug build.
uninstallDevRemoteKernelRelease - Uninstalls the ReleaseDevRemoteKernel build.
uninstallProdDebug - Uninstalls the DebugProd build.
uninstallProdDebugAndroidTest - Uninstalls the android (on device) tests for the ProdDebug build.
uninstallProdRelease - Uninstalls the ReleaseProd build.
Verification tasks
------------------
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
connectedDev19DebugAndroidTest - Installs and runs the tests for dev19Debug on connected devices.
connectedDevDebugAndroidTest - Installs and runs the tests for devDebug on connected devices.
connectedDevRemoteKernelDebugAndroidTest - Installs and runs the tests for devRemoteKernelDebug on connected devices.
connectedProdDebugAndroidTest - Installs and runs the tests for prodDebug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintDev19Debug - Runs lint on the Dev19Debug build.
lintDev19Release - Runs lint on the Dev19Release build.
lintDevDebug - Runs lint on the DevDebug build.
lintDevRelease - Runs lint on the DevRelease build.
lintDevRemoteKernelDebug - Runs lint on the DevRemoteKernelDebug build.
lintDevRemoteKernelRelease - Runs lint on the DevRemoteKernelRelease build.
lintProdDebug - Runs lint on the ProdDebug build.
lintProdRelease - Runs lint on the ProdRelease build.
lintRelease - Runs lint on the Release build.
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testDev19DebugUnitTest - Run unit tests for the dev19Debug build.
testDev19ReleaseUnitTest - Run unit tests for the dev19Release build.
testDevDebugUnitTest - Run unit tests for the devDebug build.
testDevReleaseUnitTest - Run unit tests for the devRelease build.
testDevRemoteKernelDebugUnitTest - Run unit tests for the devRemoteKernelDebug build.
testDevRemoteKernelReleaseUnitTest - Run unit tests for the devRemoteKernelRelease build.
testProdDebugUnitTest - Run unit tests for the prodDebug build.
testProdReleaseUnitTest - Run unit tests for the prodRelease build.
testReleaseUnitTest - Run unit tests for the release build.
To see all tasks and more detail, run gradlew tasks --all
To see more detail about a task, run gradlew help --task <task>
BUILD SUCCESSFUL