Giter VIP home page Giter VIP logo

Comments (4)

pengrad avatar pengrad commented on June 20, 2024 1

Sorry, not connected to this lib
Check your class Map.java:95

from mapscaleview.

barayuda avatar barayuda commented on June 20, 2024

This is my gradle

`buildscript {
repositories {
jcenter()
}
dependencies {
if (rootProject.ext.has("gradle_classpath")) {
classpath rootProject.ext.gradle_classpath
} else {
logger.warn('classpath not found in rootProject')
classpath 'com.android.tools.build:gradle:2.3.2'
}
}
}

apply plugin: 'com.android.application'

android {

if (rootProject.ext.has("compileSdkVersion")) {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion
} else {
    logger.warn('compileSdkVersion not found in rootProject')
    compileSdkVersion 24
    buildToolsVersion "25.0.0"
}

defaultConfig {
    applicationId "de.j4velin.mapsmeasure"
    if (!project.file("key.properties").exists()) {
        resValue "string", "maps_api_key", "0000"
    }
}

signingConfigs {
    release
}

buildTypes {
    release {
        signingConfig signingConfigs.release
        zipAlignEnabled true
        minifyEnabled true
        shrinkResources false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
    }
    debug {
        signingConfig signingConfigs.release
        zipAlignEnabled true
        minifyEnabled false
        shrinkResources false
        debuggable true
    }
}

if (System.getenv("TRAVIS")) {
    lintOptions {
        ignoreWarnings true
        abortOnError false
    }
}

}

dependencies {
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.android.gms:play-services-location:10.2.6'
compile 'com.google.android.gms:play-services-maps:10.2.6'
compile 'com.github.pengrad:mapscaleview:1.2.1'
}`

from mapscaleview.

pengrad avatar pengrad commented on June 20, 2024

Add repositories { jcenter() } outside of buildscript.

Or maybe you enabled offline mode in android studio.
Try ./gradlew in terminal

from mapscaleview.

barayuda avatar barayuda commented on June 20, 2024

Thanks you,

solved by this:

allprojects {
repositories {
jcenter()
}
}


Next, I found this error.
When implementing the code:
05-19 19:47:50.286 15545-15545/com.barayuda.mapsmeasure E/AndroidRuntime: FATAL EXCEPTION: main Process: com.barayuda.mapsmeasure, PID: 15545 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.barayuda.mapsmeasure/com.barayuda.mapsmeasure.Map}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference at Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference at android.app.Activity.findViewById(Activity.java:2107) at com.barayuda.mapsmeasure.Map.<init>(Map.java:95)

and pointer refers to MapScaleView scaleView = (MapScaleView) findViewById(R.id.scaleView);

I have put this code to my layout:
<com.github.pengrad.mapscaleview.MapScaleView android:id="@+id/scaleView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="4dp"/>

from mapscaleview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.