Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not compile in Android #18

Closed
fastcodecoq opened this issue Oct 21, 2018 · 5 comments
Closed

Can not compile in Android #18

fastcodecoq opened this issue Oct 21, 2018 · 5 comments

Comments

@fastcodecoq
Copy link

I installed the library in the "easy way", and double check that settings.gradle and build.gradle are ok with you suggest. Error:

  • What went wrong:
    A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-immediate-phone-call'.
> Could not resolve all dependencies for configuration ':react-native-immediate-phone-call:_debugPublishCopy'.
> Could not find com.android.support:appcompat-v7:27.1.1.
Searched in the following locations:
file:/Users/javiergomez/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/javiergomez/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
file:/Users/javiergomez/Dev/eyios6/android/sdk-manager/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
Required by:
eyios6:react-native-immediate-phone-call:unspecified > com.facebook.react:react-native:0.57.2

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
@wumke
Copy link
Owner

wumke commented Oct 22, 2018

You can add a appcompat library as dependency in your project, I've had similar issues with conflicts between dependencies of different libraries... but I'm not completely sure what the best way is to handle this, and if it can be handled 100% automatically by the dependency system in case of conflicts etc.

For now it will be an additional, manual task... I will mention it in the readme in next update!

OFFTOPIC:
For the same reason I always include all npm repo's in my project repo after i 'npm installed' them, then I can make minor changes to logic and build scripts and be sure nothing will break due to an unannounced change in my dependencies their dependencies!

@kailashvele
Copy link

I am not sure if its what I think but when I have problem with Android build I go to

/node_modules/react-native-immediate-phone-call/android/build.gradle

and update as following

android {
     - compileSdkVersion 23
     - buildToolsVersion "23.0.1"
     + compileSdkVersion rootProject.ext.compileSdkVersion
     + buildToolsVersion rootProject.ext.buildToolsVersion

      defaultConfig {
          ...
         - minSdkVersion 16
         - targetSdkVersion 22
         + minSdkVersion rootProject.ext.minSdkVersion
         + targetSdkVersion rootProject.ext.targetSdkVersion

          ...
      }

      ...
}

This works for me and builds the android app.

@wumke
Copy link
Owner

wumke commented Jun 12, 2019

Yes @kailashvele , I also often update compile and buildtools versions of imported libraries... If I remember correct android studio offers the option to do the upgrade itself (or at least it mentions that it ignored it and applied your main project versions while building)

@ldco2016
Copy link

ldco2016 commented Sep 13, 2019

@wumke , just go to your android folder and change build.gradle to look like so:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 28
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 2
        versionName "1.1"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    lintOptions {
       warning 'InvalidPackage'
    }
}

dependencies {
    compile 'com.facebook.react:react-native:+'
}

Please make that part of your new version that will get rid of the get rid of com.android.builder.internal.aapt.v2.Aapt2Exception many of us are having.

@wumke
Copy link
Owner

wumke commented Apr 4, 2022

see #30

@wumke wumke closed this as completed Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants